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

Unified Diff: content/renderer/service_worker/service_worker_script_context.cc

Issue 912753002: Stop Service Workers that execute JavaScript for too long. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rethink Created 5 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/renderer/service_worker/service_worker_script_context.cc
diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
index 372c7b9fbcd67cc9e6adbad3d007cb1b0d0f2c9a..61c83be92c07d65acefa1f12d5b4f623131b33db 100644
--- a/content/renderer/service_worker/service_worker_script_context.cc
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -127,6 +127,7 @@ void ServiceWorkerScriptContext::OnMessageReceived(
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError)
+ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_Ping, OnPing);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -582,4 +583,8 @@ void ServiceWorkerScriptContext::OnClaimClientsError(
pending_claim_clients_callbacks_.Remove(request_id);
}
+void ServiceWorkerScriptContext::OnPing() {
+ Send(new ServiceWorkerHostMsg_Pong(GetRoutingID()));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698