Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2015 Google Inc. All rights reserved. | 3 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 | 63 |
| 64 SmallStringKey(WTF::HashTableDeletedValueType) | 64 SmallStringKey(WTF::HashTableDeletedValueType) |
| 65 : m_length(s_deletedValueLength), | 65 : m_length(s_deletedValueLength), |
| 66 m_direction(static_cast<unsigned>(TextDirection::kLtr)) {} | 66 m_direction(static_cast<unsigned>(TextDirection::kLtr)) {} |
| 67 | 67 |
| 68 template <typename CharacterType> | 68 template <typename CharacterType> |
| 69 SmallStringKey(CharacterType* characters, | 69 SmallStringKey(CharacterType* characters, |
| 70 unsigned short length, | 70 unsigned short length, |
| 71 TextDirection direction) | 71 TextDirection direction) |
| 72 : m_length(length), m_direction(static_cast<unsigned>(direction)) { | 72 : m_length(length), m_direction(static_cast<unsigned>(direction)) { |
| 73 ASSERT(length <= s_capacity); | 73 DCHECK(length <= s_capacity); |
|
tkent
2017/04/09 23:13:23
Use DCHECK_LE
Hwanseung Lee
2017/04/11 22:25:09
it was cause of build fail. so i did not change.
| |
| 74 | 74 |
| 75 StringHasher hasher; | 75 StringHasher hasher; |
| 76 | 76 |
| 77 bool remainder = length & 1; | 77 bool remainder = length & 1; |
| 78 length >>= 1; | 78 length >>= 1; |
| 79 | 79 |
| 80 unsigned i = 0; | 80 unsigned i = 0; |
| 81 while (length--) { | 81 while (length--) { |
| 82 m_characters[i] = characters[i]; | 82 m_characters[i] = characters[i]; |
| 83 m_characters[i + 1] = characters[i + 1]; | 83 m_characters[i + 1] = characters[i + 1]; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 inline bool operator==(const ShapeCache::SmallStringKey& a, | 250 inline bool operator==(const ShapeCache::SmallStringKey& a, |
| 251 const ShapeCache::SmallStringKey& b) { | 251 const ShapeCache::SmallStringKey& b) { |
| 252 if (a.length() != b.length() || a.direction() != b.direction()) | 252 if (a.length() != b.length() || a.direction() != b.direction()) |
| 253 return false; | 253 return false; |
| 254 return WTF::equal(a.characters(), b.characters(), a.length()); | 254 return WTF::equal(a.characters(), b.characters(), a.length()); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace blink | 257 } // namespace blink |
| 258 | 258 |
| 259 #endif // ShapeCache_h | 259 #endif // ShapeCache_h |
| OLD | NEW |