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

Unified Diff: content/renderer/shared_worker/websharedworker_proxy.cc

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: content/renderer/shared_worker/websharedworker_proxy.cc
diff --git a/content/renderer/shared_worker/websharedworker_proxy.cc b/content/renderer/shared_worker/websharedworker_proxy.cc
index 628b14df5a38d8dc74af916a4e38f19eb6199d4c..221ba5beab3361d96a789ed54e60d966938a8384 100644
--- a/content/renderer/shared_worker/websharedworker_proxy.cc
+++ b/content/renderer/shared_worker/websharedworker_proxy.cc
@@ -60,6 +60,8 @@ bool WebSharedWorkerProxy::OnMessageReceived(const IPC::Message& message) {
OnWorkerScriptLoadFailed)
IPC_MESSAGE_HANDLER(ViewMsg_WorkerConnected,
OnWorkerConnected)
+ IPC_MESSAGE_HANDLER(ViewMsg_WorkerDestroyed, OnWorkerDestroyed)
+ IPC_MESSAGE_HANDLER(ViewMsg_CountFeatureOnSharedWorker, OnCountFeature)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -76,9 +78,18 @@ void WebSharedWorkerProxy::OnWorkerScriptLoadFailed() {
delete this;
}
-void WebSharedWorkerProxy::OnWorkerConnected() {
+void WebSharedWorkerProxy::OnWorkerConnected(std::set<uint32_t> features) {
listener_->connected();
+ for (uint32_t feature : features)
+ listener_->countFeature(feature);
+}
+
+void WebSharedWorkerProxy::OnWorkerDestroyed() {
delete this;
}
+void WebSharedWorkerProxy::OnCountFeature(uint32_t feature) {
+ listener_->countFeature(feature);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698