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

Unified Diff: content/browser/shared_worker/shared_worker_host.cc

Issue 2586863002: Worker: Enable UseCounter for SharedWorkerGlobalScope (Closed)
Patch Set: simplify 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..21e223699e6dba7dda23ca2d9ab32b2957729a6e 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 feature) {
+ if (!used_features_.insert(feature).second)
+ return;
+ for (const auto& filter_info : filters_) {
+ filter_info.filter()->Send(new ViewMsg_CountFeatureOnSharedWorker(
+ filter_info.route_id(), feature));
+ }
+}
+
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(), used_features_));
return;
}
}
« no previous file with comments | « content/browser/shared_worker/shared_worker_host.h ('k') | content/browser/shared_worker/shared_worker_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698