Chromium Code Reviews| 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 6a54f6af64e41b847fe05d8ec705f3f275a46666..9cd9f3405a49693fb4a06d1c527792388f028eb1 100644 |
| --- a/content/browser/service_worker/service_worker_request_handler.cc |
| +++ b/content/browser/service_worker/service_worker_request_handler.cc |
| @@ -14,6 +14,7 @@ |
| #include "content/browser/service_worker/service_worker_utils.h" |
| #include "content/common/resource_request_body.h" |
| #include "content/common/service_worker/service_worker_types.h" |
| +#include "content/public/browser/resource_context.h" |
| #include "net/base/net_util.h" |
| #include "net/url_request/url_request.h" |
| #include "net/url_request/url_request_interceptor.h" |
| @@ -28,7 +29,8 @@ int kUserDataKey; // Key value is not important. |
| class ServiceWorkerRequestInterceptor |
| : public net::URLRequestInterceptor { |
| public: |
| - ServiceWorkerRequestInterceptor() {} |
| + ServiceWorkerRequestInterceptor(ResourceContext* resource_context) |
|
jochen (gone - plz use gerrit)
2014/10/15 15:26:10
explicit
|
| + : resource_context_(resource_context) {} |
| virtual ~ServiceWorkerRequestInterceptor() {} |
| virtual net::URLRequestJob* MaybeInterceptRequest( |
| net::URLRequest* request, |
| @@ -37,10 +39,12 @@ class ServiceWorkerRequestInterceptor |
| ServiceWorkerRequestHandler::GetHandler(request); |
| if (!handler) |
| return NULL; |
| - return handler->MaybeCreateJob(request, network_delegate); |
| + return handler->MaybeCreateJob( |
| + request, network_delegate, resource_context_); |
| } |
| private: |
| + ResourceContext* resource_context_; |
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor); |
| }; |
| @@ -110,9 +114,10 @@ ServiceWorkerRequestHandler* ServiceWorkerRequestHandler::GetHandler( |
| } |
| scoped_ptr<net::URLRequestInterceptor> |
| -ServiceWorkerRequestHandler::CreateInterceptor() { |
| +ServiceWorkerRequestHandler::CreateInterceptor( |
| + ResourceContext* resource_context) { |
| return scoped_ptr<net::URLRequestInterceptor>( |
| - new ServiceWorkerRequestInterceptor); |
| + new ServiceWorkerRequestInterceptor(resource_context)); |
| } |
| ServiceWorkerRequestHandler::~ServiceWorkerRequestHandler() { |