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

Unified Diff: third_party/WebKit/Source/core/testing/WorkerInternals.cpp

Issue 2586863002: Worker: Enable UseCounter for SharedWorkerGlobalScope (Closed)
Patch Set: replace ExecutionContext with ScriptState Created 3 years, 11 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/testing/WorkerInternals.cpp
diff --git a/third_party/WebKit/Source/core/testing/WorkerInternals.cpp b/third_party/WebKit/Source/core/testing/WorkerInternals.cpp
index 6d6d19bce0e8f9c333b3c59526cb95aa0351c983..97beebfe8a1890c596f3964d03e6836bce5ff4e5 100644
--- a/third_party/WebKit/Source/core/testing/WorkerInternals.cpp
+++ b/third_party/WebKit/Source/core/testing/WorkerInternals.cpp
@@ -4,6 +4,9 @@
#include "core/testing/WorkerInternals.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "core/frame/Deprecation.h"
+#include "core/frame/UseCounter.h"
#include "core/testing/OriginTrialsTest.h"
namespace blink {
@@ -16,4 +19,19 @@ OriginTrialsTest* WorkerInternals::originTrialsTest() const {
return OriginTrialsTest::create();
}
+void WorkerInternals::countFeature(ScriptState* scriptState, uint32_t feature) {
+ static_assert(UseCounter::NumberOfFeatures < UINT32_MAX,
+ "uint32_t must be larger than number of features");
+ UseCounter::count(scriptState->getExecutionContext(),
+ static_cast<UseCounter::Feature>(feature));
+}
+
+void WorkerInternals::countDeprecation(ScriptState* scriptState,
+ uint32_t feature) {
+ static_assert(UseCounter::NumberOfFeatures < UINT32_MAX,
+ "uint32_t must be larger than number of features");
+ Deprecation::countDeprecation(scriptState->getExecutionContext(),
+ static_cast<UseCounter::Feature>(feature));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698