OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |