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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host.cc

Issue 459003002: Plumbs URLRequestContext and CacheBlobStorageContext down to cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cache1
Patch Set: Addresses michaeln's comments from PS5 Created 6 years, 4 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 2c68c82a3ef598b0c94388ea3e0f3f08943f3bcb..9c43c15605d42deabecec88374388ee92ff7b3ea 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/message_port_message_filter.h"
#include "content/browser/message_port_service.h"
#include "content/browser/service_worker/embedded_worker_registry.h"
@@ -17,8 +18,10 @@
#include "content/common/service_worker/embedded_worker_messages.h"
#include "content/common/service_worker/service_worker_messages.h"
#include "ipc/ipc_message_macros.h"
+#include "net/url_request/url_request_context_getter.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerError.h"
#include "url/gurl.h"
+#include "webkit/browser/blob/blob_storage_context.h"
using blink::WebServiceWorkerError;
@@ -74,17 +77,26 @@ ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {
}
void ServiceWorkerDispatcherHost::Init(
- ServiceWorkerContextWrapper* context_wrapper) {
+ ServiceWorkerContextWrapper* context_wrapper,
+ net::URLRequestContextGetter* request_context,
+ ChromeBlobStorageContext* blob_storage) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&ServiceWorkerDispatcherHost::Init,
- this, make_scoped_refptr(context_wrapper)));
+ BrowserThread::PostTask(BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&ServiceWorkerDispatcherHost::Init,
+ this,
+ make_scoped_refptr(context_wrapper),
+ make_scoped_refptr(request_context),
+ make_scoped_refptr(blob_storage)));
return;
}
context_wrapper_ = context_wrapper;
GetContext()->embedded_worker_registry()->AddChildProcessSender(
render_process_id_, this);
+ if (blob_storage->context())
michaeln 2014/08/13 02:03:37 can that ever be null?
jkarlin 2014/08/13 11:56:42 No, not on the IO thread. Done.
+ context_wrapper_->SetBlobParametersForCache(
+ request_context->GetURLRequestContext(),
+ blob_storage->context()->AsWeakPtr());
}
void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Sender* sender) {

Powered by Google App Engine
This is Rietveld 408576698