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

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

Issue 992353003: Decouple Cache Storage messaging from Service Worker/Embedded Worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused public stubs Created 5 years, 9 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 7bd700c11d864897915fe319d65abd055987c982..91f293cfa51fe234c79e70ea195a13d7523112fd 100644
--- a/content/renderer/service_worker/service_worker_script_context.cc
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -15,6 +15,7 @@
#include "content/common/service_worker/service_worker_messages.h"
#include "content/public/common/referrer.h"
#include "content/renderer/service_worker/embedded_worker_context_client.h"
+#include "content/renderer/service_worker/webserviceworkercachestorage_impl.h"
#include "ipc/ipc_message.h"
#include "third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h"
#include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
@@ -96,8 +97,10 @@ ToWebServiceWorkerClientInfo(const ServiceWorkerClientInfo& client_info) {
ServiceWorkerScriptContext::ServiceWorkerScriptContext(
EmbeddedWorkerContextClient* embedded_context,
blink::WebServiceWorkerContextProxy* proxy)
- : cache_storage_dispatcher_(new ServiceWorkerCacheStorageDispatcher(this)),
- embedded_context_(embedded_context),
+ : embedded_context_(embedded_context),
+ cache_storage_(new WebServiceWorkerCacheStorageImpl(
+ embedded_context->thread_safe_sender(),
+ embedded_context->origin())),
proxy_(proxy) {
}
@@ -135,11 +138,6 @@ void ServiceWorkerScriptContext::OnMessageReceived(
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);
}

Powered by Google App Engine
This is Rietveld 408576698