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

Unified Diff: Source/core/page/UseCounter.h

Issue 14146021: Move deprecation messages to UseCounter::measureDeprecatedFeature. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 8 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 | « Source/core/page/PageConsole.cpp ('k') | Source/core/page/UseCounter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/UseCounter.h
diff --git a/Source/core/page/UseCounter.h b/Source/core/page/UseCounter.h
index e574073db1d04f9acdbde5a5b9103e3dc12795ff..73a36212e741b9d3c07691d73063357c926e06a5 100644
--- a/Source/core/page/UseCounter.h
+++ b/Source/core/page/UseCounter.h
@@ -26,15 +26,17 @@
#ifndef UseCounter_h
#define UseCounter_h
-#include <wtf/BitVector.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
+#include "wtf/BitVector.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/text/WTFString.h"
namespace WebCore {
class DOMWindow;
class Document;
+class ScriptExecutionContext;
// UseCounter is used for counting the number of times features of
// Blink are used on real web pages and help us know commonly
@@ -125,6 +127,9 @@ public:
PrefixedUserTiming,
WindowEvent,
ContentSecurityPolicyWithBaseElement,
+ PrefixedMediaAddKey,
+ PrefixedMediaGenerateKeyRequest,
+ WebAudioLooping,
// Add new features above this line. Don't change assigned numbers of each items.
NumberOfFeatures, // This enum value must be last.
};
@@ -132,10 +137,21 @@ public:
// "observe" sets the bit for this feature to 1. Repeated calls are ignored.
static void observe(Document*, Feature);
static void observe(DOMWindow*, Feature);
+
+ // "measureDeprecatedFeature" sets the bit for this feature to 1, and sends a deprecation
+ // warning to the console. Repeated calls are ignored.
+ //
+ // Be considerate to developers' consoles: features should only send deprecation warnings
+ // when we're actively interested in removing them from the platform.
+ static void measureDeprecatedFeature(DOMWindow*, Feature);
+ static void measureDeprecatedFeature(ScriptExecutionContext*, Feature);
+ static void measureDeprecatedFeature(Document*, Feature);
+ String deprecationMessage(Feature);
+
void didCommitLoad();
private:
- void didObserve(Feature feature)
+ bool recordObservation(Feature feature)
{
ASSERT(feature != PageDestruction); // PageDestruction is reserved as a scaling factor.
ASSERT(feature < NumberOfFeatures);
@@ -143,7 +159,12 @@ private:
m_countBits = adoptPtr(new BitVector(NumberOfFeatures));
m_countBits->clearAll();
}
+
+ if (m_countBits->quickGet(feature))
+ return false;
+
m_countBits->quickSet(feature);
+ return true;
}
void updateMeasurements();
« no previous file with comments | « Source/core/page/PageConsole.cpp ('k') | Source/core/page/UseCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698