Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FallbackListCompositeKey.h

Issue 2615813003: Migrate WTF::Vector::append() to ::push_back() [part 14 of N] (Closed)
Patch Set: rebase, small fix in FontSettings.h Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef FallbackListCompositeKey_h 5 #ifndef FallbackListCompositeKey_h
6 #define FallbackListCompositeKey_h 6 #define FallbackListCompositeKey_h
7 7
8 #include "platform/fonts/FontCacheKey.h" 8 #include "platform/fonts/FontCacheKey.h"
9 #include "platform/fonts/FontDescription.h" 9 #include "platform/fonts/FontDescription.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
(...skipping 29 matching lines...) Expand all
40 m_auxiliaryBitmapFields(0) {} 40 m_auxiliaryBitmapFields(0) {}
41 FallbackListCompositeKey(WTF::HashTableDeletedValueType) 41 FallbackListCompositeKey(WTF::HashTableDeletedValueType)
42 : m_hash(s_deletedValueHash), 42 : m_hash(s_deletedValueHash),
43 m_computedSize(0), 43 m_computedSize(0),
44 m_letterSpacing(0), 44 m_letterSpacing(0),
45 m_wordSpacing(0), 45 m_wordSpacing(0),
46 m_bitmapFields(0), 46 m_bitmapFields(0),
47 m_auxiliaryBitmapFields(0) {} 47 m_auxiliaryBitmapFields(0) {}
48 48
49 void add(FontCacheKey key) { 49 void add(FontCacheKey key) {
50 m_fontCacheKeys.append(key); 50 m_fontCacheKeys.push_back(key);
51 // Djb2 with the first bit reserved for deleted. 51 // Djb2 with the first bit reserved for deleted.
52 m_hash = (((m_hash << 5) + m_hash) + key.hash()) << 1; 52 m_hash = (((m_hash << 5) + m_hash) + key.hash()) << 1;
53 } 53 }
54 54
55 unsigned hash() const { return m_hash; } 55 unsigned hash() const { return m_hash; }
56 56
57 bool operator==(const FallbackListCompositeKey& other) const { 57 bool operator==(const FallbackListCompositeKey& other) const {
58 return m_hash == other.m_hash && m_computedSize == other.m_computedSize && 58 return m_hash == other.m_hash && m_computedSize == other.m_computedSize &&
59 m_letterSpacing == other.m_letterSpacing && 59 m_letterSpacing == other.m_letterSpacing &&
60 m_wordSpacing == other.m_wordSpacing && 60 m_wordSpacing == other.m_wordSpacing &&
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 }; 93 };
94 94
95 struct FallbackListCompositeKeyTraits 95 struct FallbackListCompositeKeyTraits
96 : WTF::SimpleClassHashTraits<FallbackListCompositeKey> { 96 : WTF::SimpleClassHashTraits<FallbackListCompositeKey> {
97 STATIC_ONLY(FallbackListCompositeKeyTraits); 97 STATIC_ONLY(FallbackListCompositeKeyTraits);
98 }; 98 };
99 99
100 } // namespace blink 100 } // namespace blink
101 101
102 #endif // FallbackListCompositeKey_h 102 #endif // FallbackListCompositeKey_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698