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

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

Issue 2290733002: Add new UseCounter metric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Overhaul tests Created 4 years, 3 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
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 f42a496e4a02eb2725ae0f773c04c99303ac0ebc..2a34f4c0503db052a4ce43b5be34f93aefaeed7d 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -59,12 +59,11 @@ class CORE_EXPORT UseCounter {
WTF_MAKE_NONCOPYABLE(UseCounter);
public:
UseCounter();
- ~UseCounter();
enum Feature {
// Do not change assigned numbers of existing items: add new features
// to the end of the list.
- PageDestruction = 0,
+ OBSOLETE_PageDestruction = 0,
PrefixedIndexedDB = 3,
WorkerStart = 4,
SharedWorkerStart = 5,
@@ -1338,11 +1337,24 @@ public:
bool hasRecordedMeasurement(Feature) const;
protected:
- friend class UseCounterTest;
+ // Encapsulates the work to preserve the old "FeatureObserver" histogram with original semantics
+ // TODO(rbyers): remove this - http://crbug.com/597963
+ class LegacyCounter {
+ public:
+ LegacyCounter();
+ ~LegacyCounter();
+ void countFeature(Feature);
+ void countCSS(CSSPropertyID);
+ void updateMeasurements();
+ private:
+ BitVector m_featureBits;
+ BitVector m_CSSBits;
+ } m_legacyCounter;
+
unsigned m_muteCount;
- BitVector m_featureBits;
- BitVector m_CSSFeatureBits;
+ BitVector m_featuresRecorded;
+ BitVector m_CSSRecorded;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698