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

Unified Diff: third_party/WebKit/Source/core/frame/UseCounter.h

Issue 2796283005: Adding UseCounter specific for extensions (Closed)
Patch Set: Fix compile err Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/histogram_tester.cc ('k') | third_party/WebKit/Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/UseCounter.h
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h
index f6209bfbf07310e33332a7888b0df623891f4463..9cb7078b7acde97dc4d1a6f437b136605c00073a 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -67,7 +67,12 @@ class CORE_EXPORT UseCounter {
enum Context {
kDefaultContext,
// Counters for SVGImages (lifetime independent from other pages).
- kSVGImageContext
+ kSVGImageContext,
+ // Counters for extensions.
+ kExtensionContext,
+ // Context when counters should be disabled (eg, internal pages such as
+ // about, chrome-devtools, etc).
+ kDisabledContext
};
UseCounter(Context = kDefaultContext);
@@ -1594,8 +1599,8 @@ class CORE_EXPORT UseCounter {
};
// An interface to observe UseCounter changes. Note that this is never
- // notified when the counter is disabled by |m_muteCount| or
- // |m_disableReporting|.
+ // notified when the counter is disabled by |m_muteCount| or when |m_context|
+ // is kDisabledContext.
class Observer : public GarbageCollected<Observer> {
public:
// Notified when a feature is counted for the first time. This should return
@@ -1657,8 +1662,8 @@ class CORE_EXPORT UseCounter {
private:
// Notifies that a feature is newly counted to |m_observers|. This shouldn't
- // be called when the counter is disabled by |m_muteCount| or
- // |m_disableReporting|.
+ // be called when the counter is disabled by |m_muteCount| or when |m_context|
+ // if kDisabledContext.
void NotifyFeatureCounted(Feature);
EnumerationHistogram& FeaturesHistogram() const;
@@ -1668,10 +1673,8 @@ class CORE_EXPORT UseCounter {
// If non-zero, ignore all 'count' calls completely.
unsigned mute_count_;
- // If true, disable reporting all histogram entries.
- bool disable_reporting_;
-
- // The scope represented by this UseCounter instance.
+ // The scope represented by this UseCounter instance, which must be fixed for
+ // the duration of a page but can change when a new page is loaded.
Context context_;
// Track what features/properties have been reported to the (non-legacy)
« no previous file with comments | « base/test/histogram_tester.cc ('k') | third_party/WebKit/Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698