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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_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_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index f23aece6697dd199ee86bd81e291c93396551376..3cf6c63a029588df6045ac46ff6870c5983f6d0f 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -211,6 +211,7 @@ bool ServiceWorkerDispatcherHost::OnMessageReceived(
OnWorkerStarted)
IPC_MESSAGE_HANDLER(EmbeddedWorkerHostMsg_WorkerStopped,
OnWorkerStopped)
+ IPC_MESSAGE_HANDLER(EmbeddedWorkerHostMsg_CountFeature, OnCountFeature)
IPC_MESSAGE_HANDLER(EmbeddedWorkerHostMsg_ReportException,
OnReportException)
IPC_MESSAGE_HANDLER(EmbeddedWorkerHostMsg_ReportConsoleMessage,
@@ -1488,6 +1489,16 @@ void ServiceWorkerDispatcherHost::OnWorkerStopped(int embedded_worker_id) {
registry->OnWorkerStopped(render_process_id_, embedded_worker_id);
}
+void ServiceWorkerDispatcherHost::OnCountFeature(int64_t version_id,
+ uint32_t feature) {
+ if (!GetContext())
+ return;
+ ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id);
+ if (!version)
+ return;
+ version->CountFeature(feature);
+}
+
void ServiceWorkerDispatcherHost::OnReportException(
int embedded_worker_id,
const base::string16& error_message,

Powered by Google App Engine
This is Rietveld 408576698