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

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

Issue 986583002: Collect host of Web Component usage to send to RAPPOR (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix typo Created 5 years, 9 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/dom/Element.idl ('k') | Source/core/frame/OriginsUsingFeatures.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef OriginsUsingFeatures_h
6 #define OriginsUsingFeatures_h
7
8 #include "platform/heap/Handle.h"
9 #include "wtf/Vector.h"
10 #include "wtf/text/WTFString.h"
11
12 namespace blink {
13
14 class Document;
15 class ScriptState;
16
17 class OriginsUsingFeatures {
18 DISALLOW_ALLOCATION();
19 public:
20 ~OriginsUsingFeatures();
21
22 enum class Feature {
23 ElementCreateShadowRoot,
24 DocumentRegisterElement,
25
26 NumberOfFeatures // This must be the last item.
27 };
28
29 static void count(const ScriptState*, Document&, Feature);
30
31 void documentDetached(Document&);
32 void updateMeasurementsAndClear();
33
34 class Value {
35 public:
36 Value();
37
38 bool isEmpty() const { return !m_countBits; }
39 void clear() { m_countBits = 0; }
40
41 void count(Feature);
42 bool get(Feature feature) const { return m_countBits & (1 << static_cast <unsigned>(feature)); }
43
44 void aggregate(Value);
45 void updateMeasurements(const String& origin);
46
47 private:
48 unsigned m_countBits : static_cast<unsigned>(Feature::NumberOfFeatures);
49 };
50
51 private:
52 Vector<std::pair<String, OriginsUsingFeatures::Value>, 1> m_originAndValues;
53 };
54
55 } // namespace blink
56
57 #endif // OriginsUsingFeatures_h
OLDNEW
« no previous file with comments | « Source/core/dom/Element.idl ('k') | Source/core/frame/OriginsUsingFeatures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698