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

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

Issue 2857583003: Worker: Avoid sending IPC messages for features already counted (Closed)
Patch Set: wip Created 3 years, 7 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/workers/WorkerOrWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
index 8eb68d95ed6aac2eef43b9d995896464722db698..2fd4a653f8c79f8bb316c129630bc9d53e156a33 100644
--- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
@@ -41,24 +41,25 @@ class CORE_EXPORT WorkerOrWorkletGlobalScope : public ExecutionContext {
virtual void Dispose() = 0;
// Called from UseCounter to record API use in this execution context.
- virtual void CountFeature(UseCounter::Feature) = 0;
+ void CountFeature(UseCounter::Feature);
// Called from UseCounter to record deprecated API use in this execution
- // context. Sub-classes should call addDeprecationMessage() in this function.
- virtual void CountDeprecation(UseCounter::Feature) = 0;
+ // context.
+ void CountDeprecation(UseCounter::Feature);
// May return nullptr if this global scope is not threaded (i.e.,
// MainThreadWorkletGlobalScope) or after dispose() is called.
virtual WorkerThread* GetThread() const = 0;
protected:
- // Adds a deprecation message to the console.
- void AddDeprecationMessage(UseCounter::Feature);
+ virtual void ReportFeature(UseCounter::Feature) = 0;
+ virtual void ReportDeprecation(UseCounter::Feature) = 0;
private:
void RunTask(std::unique_ptr<ExecutionContextTask>, bool is_instrumented);
- BitVector deprecation_warning_bits_;
+ // This is the set of features that this worker has used.
+ BitVector used_features_;
};
DEFINE_TYPE_CASTS(

Powered by Google App Engine
This is Rietveld 408576698