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

Side by Side Diff: Source/core/frame/OriginsUsingFeatures.h

Issue 1315783003: Make classes and structures in core/frame fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « Source/core/frame/LayoutSubtreeRootList.h ('k') | Source/core/frame/PageScaleConstraints.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 OriginsUsingFeatures_h 5 #ifndef OriginsUsingFeatures_h
6 #define OriginsUsingFeatures_h 6 #define OriginsUsingFeatures_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "wtf/HashMap.h" 10 #include "wtf/HashMap.h"
(...skipping 26 matching lines...) Expand all
37 }; 37 };
38 38
39 static void countAnyWorld(Document&, Feature); 39 static void countAnyWorld(Document&, Feature);
40 static void countMainWorldOnly(const ScriptState*, Document&, Feature); 40 static void countMainWorldOnly(const ScriptState*, Document&, Feature);
41 static void countOriginOrIsolatedWorldHumanReadableName(const ScriptState*, EventTarget&, Feature); 41 static void countOriginOrIsolatedWorldHumanReadableName(const ScriptState*, EventTarget&, Feature);
42 42
43 void documentDetached(Document&); 43 void documentDetached(Document&);
44 void updateMeasurementsAndClear(); 44 void updateMeasurementsAndClear();
45 45
46 class CORE_EXPORT Value { 46 class CORE_EXPORT Value {
47 ALLOW_ONLY_INLINE_ALLOCATION();
47 public: 48 public:
48 Value(); 49 Value();
49 50
50 bool isEmpty() const { return !m_countBits; } 51 bool isEmpty() const { return !m_countBits; }
51 void clear() { m_countBits = 0; } 52 void clear() { m_countBits = 0; }
52 53
53 void count(Feature); 54 void count(Feature);
54 bool get(Feature feature) const { return m_countBits & (1 << static_cast <unsigned>(feature)); } 55 bool get(Feature feature) const { return m_countBits & (1 << static_cast <unsigned>(feature)); }
55 56
56 void aggregate(Value); 57 void aggregate(Value);
(...skipping 12 matching lines...) Expand all
69 void recordOriginsToRappor(); 70 void recordOriginsToRappor();
70 void recordNamesToRappor(); 71 void recordNamesToRappor();
71 72
72 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues; 73 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues;
73 HashMap<String, OriginsUsingFeatures::Value> m_valueByName; 74 HashMap<String, OriginsUsingFeatures::Value> m_valueByName;
74 }; 75 };
75 76
76 } // namespace blink 77 } // namespace blink
77 78
78 #endif // OriginsUsingFeatures_h 79 #endif // OriginsUsingFeatures_h
OLDNEW
« no previous file with comments | « Source/core/frame/LayoutSubtreeRootList.h ('k') | Source/core/frame/PageScaleConstraints.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698