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

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

Issue 293083002: Add a blob field to ServiceWorkerFetchResponse and read the blob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: a bit closer Created 6 years, 7 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_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
index ed26f8ead2b0a3cfa2ff8892cae7c399d376c42d..24a36685963f87916a266391edd178c2a1b3f137 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -4,6 +4,7 @@
#include "content/browser/service_worker/service_worker_request_handler.h"
+#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_provider_host.h"
@@ -22,7 +23,9 @@ int kUserDataKey; // Key value is not important.
class ServiceWorkerRequestInterceptor
: public net::URLRequestJobFactory::ProtocolHandler {
public:
- ServiceWorkerRequestInterceptor() {}
+ ServiceWorkerRequestInterceptor(
+ ChromeBlobStorageContext* blob_storage_context)
+ : blob_storage_context_(blob_storage_context) {}
virtual ~ServiceWorkerRequestInterceptor() {}
virtual net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request,
@@ -31,10 +34,13 @@ class ServiceWorkerRequestInterceptor
ServiceWorkerRequestHandler::GetHandler(request);
if (!handler)
return NULL;
- return handler->MaybeCreateJob(request, network_delegate);
+ return handler->MaybeCreateJob(
+ request, network_delegate, blob_storage_context_);
}
private:
+ scoped_refptr<ChromeBlobStorageContext> blob_storage_context_;
+
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor);
};
@@ -85,9 +91,10 @@ ServiceWorkerRequestHandler* ServiceWorkerRequestHandler::GetHandler(
}
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
-ServiceWorkerRequestHandler::CreateInterceptor() {
+ServiceWorkerRequestHandler::CreateInterceptor(
+ ChromeBlobStorageContext* blob_storage_context) {
return make_scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(
- new ServiceWorkerRequestInterceptor);
+ new ServiceWorkerRequestInterceptor(blob_storage_context));
}
ServiceWorkerRequestHandler::~ServiceWorkerRequestHandler() {

Powered by Google App Engine
This is Rietveld 408576698