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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h

Issue 2535093003: Worker: Connect UseCounter to workers and worklets (Closed)
Patch Set: Created 4 years 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/workers/WorkerOrWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
index 348dd1fcb9211c0d13092411bf4fac44acd8224c..89b92b2a735b3a22185eba0a25a51b045e9f8e10 100644
--- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
@@ -6,6 +6,7 @@
#define WorkerOrWorkletGlobalScope_h
#include "core/dom/ExecutionContext.h"
+#include "core/frame/UseCounter.h"
namespace blink {
@@ -15,6 +16,12 @@ class WorkerThread;
class CORE_EXPORT WorkerOrWorkletGlobalScope : public ExecutionContext {
public:
+ WorkerOrWorkletGlobalScope();
+ virtual ~WorkerOrWorkletGlobalScope();
+
+ // ExecutionContext
+ bool isWorkerOrWorkletGlobalScope() const final { return true; }
+
virtual ScriptWrappable* getScriptWrappable() const = 0;
virtual WorkerOrWorkletScriptController* scriptController() = 0;
@@ -28,9 +35,16 @@ class CORE_EXPORT WorkerOrWorkletGlobalScope : public ExecutionContext {
// sub-classes to perform any cleanup needed.
virtual void dispose() = 0;
+ // Called from UseCounter.
+ virtual void countFeature(UseCounter::Feature) const;
+ virtual void countDeprecation(UseCounter::Feature) const;
+
// May return nullptr if this global scope is not threaded (i.e.,
// MainThreadWorkletGlobalScope) or after dispose() is called.
virtual WorkerThread* thread() const = 0;
+
+ private:
+ BitVector m_deprecationWarningBits;
};
DEFINE_TYPE_CASTS(

Powered by Google App Engine
This is Rietveld 408576698