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

Unified Diff: content/browser/appcache/appcache_interceptor.cc

Issue 625433002: Pages controlled by ServiceWorkers should not participate in AppCaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/appcache/appcache_interceptor.cc
diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc
index 7af58bdc86da7d6368c8d569227ff4ee75605ca1..1510c640645400e4cf006fd48cfb8e47ac931c2b 100644
--- a/content/browser/appcache/appcache_interceptor.cc
+++ b/content/browser/appcache/appcache_interceptor.cc
@@ -13,11 +13,37 @@
namespace content {
+class AppCacheInterceptor::StartInterceptor
+ : public net::URLRequestInterceptor {
+ public:
+ StartInterceptor() {}
+ virtual ~StartInterceptor() {}
+ virtual net::URLRequestJob* MaybeInterceptRequest(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const override {
+ AppCacheRequestHandler* handler = GetHandler(request);
+ if (!handler)
+ return NULL;
+ return handler->MaybeLoadResource(request, network_delegate);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(StartInterceptor);
+};
+
+
// static
AppCacheInterceptor* AppCacheInterceptor::GetInstance() {
return Singleton<AppCacheInterceptor>::get();
}
+// static
+scoped_ptr<net::URLRequestInterceptor>
+AppCacheInterceptor::CreateStartInterceptor() {
+ return scoped_ptr<net::URLRequestInterceptor>(
+ new StartInterceptor);
+}
+
void AppCacheInterceptor::SetHandler(net::URLRequest* request,
AppCacheRequestHandler* handler) {
request->SetUserData(GetInstance(), handler); // request takes ownership
@@ -96,10 +122,8 @@ AppCacheInterceptor::~AppCacheInterceptor() {
net::URLRequestJob* AppCacheInterceptor::MaybeIntercept(
net::URLRequest* request, net::NetworkDelegate* network_delegate) {
- AppCacheRequestHandler* handler = GetHandler(request);
- if (!handler)
- return NULL;
- return handler->MaybeLoadResource(request, network_delegate);
+ // Intentionally empty, handled by class StartInterceptor.
+ return NULL;
}
net::URLRequestJob* AppCacheInterceptor::MaybeInterceptRedirect(
« no previous file with comments | « content/browser/appcache/appcache_interceptor.h ('k') | content/browser/appcache/appcache_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698