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

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

Issue 637243003: Service Worker: Obey content settings when deciding to control a page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@content
Patch Set: explicit, and better log Created 6 years, 2 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 6a54f6af64e41b847fe05d8ec705f3f275a46666..55ae2e12519156135fd1f5f20d9e4a04b19071c5 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() {}
+ explicit ServiceWorkerRequestInterceptor(ResourceContext* resource_context)
+ : 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() {
« no previous file with comments | « content/browser/service_worker/service_worker_request_handler.h ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698