| 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" |
| 11 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
| 12 #include "wtf/text/StringHash.h" | 12 #include "wtf/text/StringHash.h" |
| 13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class Document; | 17 class Document; |
| 18 class EventTarget; | 18 class EventTarget; |
| 19 class ScriptState; | 19 class ScriptState; |
| 20 | 20 |
| 21 class CORE_EXPORT OriginsUsingFeatures { | 21 class CORE_EXPORT OriginsUsingFeatures { |
| 22 DISALLOW_ALLOCATION(); | 22 DISALLOW_ALLOCATION(); |
| 23 public: | 23 public: |
| 24 ~OriginsUsingFeatures(); | 24 ~OriginsUsingFeatures(); |
| 25 | 25 |
| 26 // Features for RAPPOR. Do not reorder or remove! |
| 26 enum class Feature { | 27 enum class Feature { |
| 27 ElementCreateShadowRoot, | 28 ElementCreateShadowRoot, |
| 28 DocumentRegisterElement, | 29 DocumentRegisterElement, |
| 29 EventPath, | 30 EventPath, |
| 30 DeviceMotionInsecureOrigin, | 31 DeviceMotionInsecureOrigin, |
| 31 DeviceOrientationInsecureOrigin, | 32 DeviceOrientationInsecureOrigin, |
| 32 FullscreenInsecureOrigin, | 33 FullscreenInsecureOrigin, |
| 33 GeolocationInsecureOrigin, | 34 GeolocationInsecureOrigin, |
| 34 GetUserMediaInsecureOrigin, | 35 GetUserMediaInsecureOrigin, |
| 36 GetUserMediaSecureOrigin, |
| 35 | 37 |
| 36 NumberOfFeatures // This must be the last item. | 38 NumberOfFeatures // This must be the last item. |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 static void countAnyWorld(Document&, Feature); | 41 static void countAnyWorld(Document&, Feature); |
| 40 static void countMainWorldOnly(const ScriptState*, Document&, Feature); | 42 static void countMainWorldOnly(const ScriptState*, Document&, Feature); |
| 41 static void countOriginOrIsolatedWorldHumanReadableName(const ScriptState*,
EventTarget&, Feature); | 43 static void countOriginOrIsolatedWorldHumanReadableName(const ScriptState*,
EventTarget&, Feature); |
| 42 | 44 |
| 43 void documentDetached(Document&); | 45 void documentDetached(Document&); |
| 44 void updateMeasurementsAndClear(); | 46 void updateMeasurementsAndClear(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 70 void recordOriginsToRappor(); | 72 void recordOriginsToRappor(); |
| 71 void recordNamesToRappor(); | 73 void recordNamesToRappor(); |
| 72 | 74 |
| 73 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues; | 75 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues; |
| 74 HashMap<String, OriginsUsingFeatures::Value> m_valueByName; | 76 HashMap<String, OriginsUsingFeatures::Value> m_valueByName; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace blink | 79 } // namespace blink |
| 78 | 80 |
| 79 #endif // OriginsUsingFeatures_h | 81 #endif // OriginsUsingFeatures_h |
| OLD | NEW |