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

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

Issue 379303002: Content blink::WebServiceWorkerCacheStorage implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self review for style Created 6 years, 5 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 6d246f8a22da2450557a94b6590df6ca243c7433..62b060edf6e4bda74b7705caa73f0ae352d75639 100644
--- a/content/renderer/service_worker/service_worker_script_context.cc
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -39,7 +39,8 @@ void SendPostMessageToDocumentOnMainThread(
ServiceWorkerScriptContext::ServiceWorkerScriptContext(
EmbeddedWorkerContextClient* embedded_context,
blink::WebServiceWorkerContextProxy* proxy)
- : embedded_context_(embedded_context),
+ : cache_storage_dispatcher_(new ServiceWorkerCacheStorageDispatcher(this)),
+ embedded_context_(embedded_context),
proxy_(proxy) {
}
@@ -59,6 +60,12 @@ void ServiceWorkerScriptContext::OnMessageReceived(
OnDidGetClientDocuments)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ // TODO(gavinp): Would it be preferable to put an AddListener() method to
+ // EmbeddedWorkerContextClient?
+ if (!handled)
+ handled = cache_storage_dispatcher_->OnMessageReceived(message);
+
DCHECK(handled);
}
@@ -116,6 +123,11 @@ void ServiceWorkerScriptContext::Send(IPC::Message* message) {
embedded_context_->Send(message);
}
+int ServiceWorkerScriptContext::GetRoutingID() const {
+ return embedded_context_->embedded_worker_id();
+}
+
+class WebServiceWorkerCacheStorage;
falken 2014/07/28 04:48:59 this is not meant to be here?
gavinp 2014/07/28 04:55:27 Done.
void ServiceWorkerScriptContext::OnActivateEvent(int request_id) {
proxy_->dispatchActivateEvent(request_id);
}
@@ -187,8 +199,4 @@ void ServiceWorkerScriptContext::OnDidGetClientDocuments(
pending_clients_callbacks_.Remove(request_id);
}
-int ServiceWorkerScriptContext::GetRoutingID() const {
- return embedded_context_->embedded_worker_id();
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698