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

Unified Diff: content/browser/shared_worker/shared_worker_host.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/browser/shared_worker/shared_worker_host.cc
diff --git a/content/browser/shared_worker/shared_worker_host.cc b/content/browser/shared_worker/shared_worker_host.cc
index a41e5b623355657c468ae26353c36bbf10d56413..e99453fff3898772f4661bfa1d7f14014a74b10a 100644
--- a/content/browser/shared_worker/shared_worker_host.cc
+++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -130,6 +130,15 @@ void SharedWorkerHost::RenderFrameDetached(int render_process_id,
}
}
+void SharedWorkerHost::CountFeature(uint32_t use_counter_id) {
+ if (!use_counter_.insert(use_counter_id).second)
+ return;
+ for (const auto& filter_info : filters_) {
+ filter_info.filter()->Send(new ViewMsg_CountFeatureOnSharedWorker(
+ filter_info.route_id(), use_counter_id));
+ }
+}
+
void SharedWorkerHost::WorkerContextClosed() {
// Set the closed flag - this will stop any further messages from
// being sent to the worker (messages can still be sent from the worker,
@@ -139,6 +148,13 @@ void SharedWorkerHost::WorkerContextClosed() {
NotifyWorkerDestroyed(worker_process_id_, worker_route_id_);
}
+void SharedWorkerHost::WorkerContextDestroyed() {
+ for (const auto& filter_info : filters_) {
+ filter_info.filter()->Send(
+ new ViewMsg_WorkerDestroyed(filter_info.route_id()));
+ }
+}
+
void SharedWorkerHost::WorkerReadyForInspection() {
NotifyWorkerReadyForInspection(worker_process_id_, worker_route_id_);
}
@@ -159,7 +175,8 @@ void SharedWorkerHost::WorkerConnected(int message_port_id) {
for (const FilterInfo& info : filters_) {
if (info.message_port_id() != message_port_id)
continue;
- info.filter()->Send(new ViewMsg_WorkerConnected(info.route_id()));
+ info.filter()->Send(
+ new ViewMsg_WorkerConnected(info.route_id(), use_counter_));
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698