| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 NumberOfFeatures // This must be the last item. | 31 NumberOfFeatures // This must be the last item. |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 static void count(const ScriptState*, Document&, Feature); | 34 static void count(const ScriptState*, Document&, Feature); |
| 35 static void countOriginOrIsolatedWorldHumanReadableName(const ScriptState*,
EventTarget&, Feature); | 35 static void countOriginOrIsolatedWorldHumanReadableName(const ScriptState*,
EventTarget&, Feature); |
| 36 | 36 |
| 37 void documentDetached(Document&); | 37 void documentDetached(Document&); |
| 38 void updateMeasurementsAndClear(); | 38 void updateMeasurementsAndClear(); |
| 39 | 39 |
| 40 class Value { | 40 class CORE_EXPORT Value { |
| 41 public: | 41 public: |
| 42 Value(); | 42 Value(); |
| 43 | 43 |
| 44 bool isEmpty() const { return !m_countBits; } | 44 bool isEmpty() const { return !m_countBits; } |
| 45 void clear() { m_countBits = 0; } | 45 void clear() { m_countBits = 0; } |
| 46 | 46 |
| 47 void count(Feature); | 47 void count(Feature); |
| 48 bool get(Feature feature) const { return m_countBits & (1 << static_cast
<unsigned>(feature)); } | 48 bool get(Feature feature) const { return m_countBits & (1 << static_cast
<unsigned>(feature)); } |
| 49 | 49 |
| 50 void aggregate(Value); | 50 void aggregate(Value); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 63 void recordOriginsToRappor(); | 63 void recordOriginsToRappor(); |
| 64 void recordNamesToRappor(); | 64 void recordNamesToRappor(); |
| 65 | 65 |
| 66 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues; | 66 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues; |
| 67 HashMap<String, OriginsUsingFeatures::Value> m_valueByName; | 67 HashMap<String, OriginsUsingFeatures::Value> m_valueByName; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| 71 | 71 |
| 72 #endif // OriginsUsingFeatures_h | 72 #endif // OriginsUsingFeatures_h |
| OLD | NEW |