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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp

Issue 2284503002: Minor UseCounter clean-ups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix dependency Created 4 years, 4 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 | « third_party/WebKit/Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
index ece0725351f377c948d311295949c44635fcac15..dfcc39e5ed015c09ec292659356ccb16f6a5acb1 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -88,10 +88,13 @@ void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const
// (http://crbug.com/376039)
DCHECK(isSharedWorkerGlobalScope() || isServiceWorkerGlobalScope() || isCompositorWorkerGlobalScope());
+ DCHECK(feature != UseCounter::PageDestruction);
+ DCHECK(feature < UseCounter::NumberOfFeatures);
+
// For each deprecated feature, send console message at most once
// per worker lifecycle.
- if (!m_deprecationWarningBits.hasRecordedMeasurement(feature)) {
- m_deprecationWarningBits.recordMeasurement(feature);
+ if (!m_deprecationWarningBits.quickGet(feature)) {
+ m_deprecationWarningBits.quickSet(feature);
DCHECK(!Deprecation::deprecationMessage(feature).isEmpty());
DCHECK(getExecutionContext());
getExecutionContext()->addConsoleMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, Deprecation::deprecationMessage(feature)));
@@ -296,6 +299,7 @@ WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
, m_url(url)
, m_userAgent(userAgent)
, m_v8CacheOptions(V8CacheOptionsDefault)
+ , m_deprecationWarningBits(UseCounter::NumberOfFeatures)
, m_scriptController(WorkerOrWorkletScriptController::create(this, thread->isolate()))
, m_thread(thread)
, m_closing(false)
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698