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

Unified Diff: content/child/service_worker/web_service_worker_provider_impl.cc

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: ready to review 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/child/service_worker/web_service_worker_provider_impl.cc
diff --git a/content/child/service_worker/web_service_worker_provider_impl.cc b/content/child/service_worker/web_service_worker_provider_impl.cc
index e2a2574c6ee8dd95dd08758f12c36cd6c934f565..75a845dfd67438103b24338b2f744fd055be3bd1 100644
--- a/content/child/service_worker/web_service_worker_provider_impl.cc
+++ b/content/child/service_worker/web_service_worker_provider_impl.cc
@@ -53,6 +53,10 @@ void WebServiceWorkerProviderImpl::setClient(
GetDispatcher()->GetOrCreateServiceWorker(
ServiceWorkerHandleReference::Create(context_->controller()->info(),
thread_safe_sender_.get()));
+
+ // Sync controllee's use counter with service worker's use counter.
+ for (uint32_t feature : context_->used_features())
+ client->countFeature(feature);
client->setController(WebServiceWorkerImpl::CreateHandle(controller),
false /* shouldNotifyControllerChange */);
}

Powered by Google App Engine
This is Rietveld 408576698