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

Unified Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: int32_t -> uint32_t 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/service_worker/service_worker_provider_host.cc
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index a32fdd32fea0d945eff3b333e822dd761e6becec..2e6394b6ff062e09ff4032a6d956c5a4062b6b96 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -248,7 +248,8 @@ void ServiceWorkerProviderHost::SetControllerVersionAttribute(
DCHECK(IsProviderForClient());
Send(new ServiceWorkerMsg_SetControllerServiceWorker(
render_thread_id_, provider_id(), GetOrCreateServiceWorkerHandle(version),
- notify_controllerchange));
+ notify_controllerchange,
+ version ? version->used_features() : std::set<uint32_t>()));
}
void ServiceWorkerProviderHost::SetHostedVersion(
@@ -459,6 +460,16 @@ void ServiceWorkerProviderHost::PostMessageToClient(
Send(new ServiceWorkerMsg_MessageToDocument(params));
}
+void ServiceWorkerProviderHost::CountFeature(uint32_t feature) {
+ if (!dispatcher_host_)
+ return; // Could be nullptr in some tests.
+
+ // CountFeature message should be sent only for controllees.
+ DCHECK(IsProviderForClient());
+ Send(new ServiceWorkerMsg_CountFeature(render_thread_id_, provider_id(),
+ feature));
+}
+
void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern(
const GURL& pattern) {
associated_patterns_.push_back(pattern);
@@ -731,7 +742,8 @@ void ServiceWorkerProviderHost::FinalizeInitialization(
render_thread_id_, provider_id(),
GetOrCreateServiceWorkerHandle(
associated_registration_->active_version()),
- false /* shouldNotifyControllerChange */));
+ false /* shouldNotifyControllerChange */,
+ associated_registration_->active_version()->used_features()));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698