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

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

Issue 2586863002: Worker: Enable UseCounter for SharedWorkerGlobalScope (Closed)
Patch Set: tweak Created 3 years, 10 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..acef5e6cab7a20873024fbf0ce6b9aba040d069d 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,19 @@ void WebSharedWorkerProxy::OnWorkerScriptLoadFailed() {
delete this;
}
-void WebSharedWorkerProxy::OnWorkerConnected() {
+void WebSharedWorkerProxy::OnWorkerConnected(
+ const std::set<uint32_t>& use_counter) {
listener_->connected();
+ for (uint32_t use_counter_id : use_counter)
+ listener_->countFeature(use_counter_id);
+}
+
+void WebSharedWorkerProxy::OnWorkerDestroyed() {
delete this;
}
+void WebSharedWorkerProxy::OnCountFeature(uint32_t use_counter_id) {
+ listener_->countFeature(use_counter_id);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698