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

Side by Side Diff: content/browser/appcache/appcache_interceptor.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/appcache/appcache_interceptor.h" 5 #include "content/browser/appcache/appcache_interceptor.h"
6 6
7 #include "content/browser/appcache/appcache_backend_impl.h" 7 #include "content/browser/appcache/appcache_backend_impl.h"
8 #include "content/browser/appcache/appcache_host.h" 8 #include "content/browser/appcache/appcache_host.h"
9 #include "content/browser/appcache/appcache_request_handler.h" 9 #include "content/browser/appcache/appcache_request_handler.h"
10 #include "content/browser/appcache/appcache_service_impl.h" 10 #include "content/browser/appcache/appcache_service_impl.h"
11 #include "content/browser/appcache/appcache_url_request_job.h" 11 #include "content/browser/appcache/appcache_url_request_job.h"
12 #include "content/common/appcache_interfaces.h" 12 #include "content/common/appcache_interfaces.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class AppCacheInterceptor::StartInterceptor 16 class AppCacheInterceptor::StartInterceptor
17 : public net::URLRequestInterceptor { 17 : public net::URLRequestInterceptor {
18 public: 18 public:
19 StartInterceptor() {} 19 StartInterceptor() {}
20 ~StartInterceptor() override {} 20 ~StartInterceptor() override {}
21 net::URLRequestJob* MaybeInterceptRequest( 21 net::URLRequestJob* MaybeInterceptRequest(
22 net::URLRequest* request, 22 net::URLRequest* request,
23 net::NetworkDelegate* network_delegate) const override { 23 net::NetworkDelegate* network_delegate) const override {
24 AppCacheRequestHandler* handler = GetHandler(request); 24 AppCacheRequestHandler* handler = GetHandler(request);
25 if (!handler) 25 if (!handler)
26 return NULL; 26 return NULL;
27 return handler->MaybeLoadResource(request, network_delegate); 27 return handler->MaybeLoadResource(request, network_delegate);
28 } 28 }
29 29
30 net::URLRequestJob* MaybeInterceptResponse(
31 net::URLRequest* request,
32 net::NetworkDelegate* network_delegate) const override {
33 return NULL;
34 }
35
36 net::URLRequestJob* MaybeInterceptRedirect(
37 net::URLRequest* request,
38 net::NetworkDelegate* network_delegate,
39 const GURL& location) const override {
40 return NULL;
41 }
42
30 private: 43 private:
31 DISALLOW_COPY_AND_ASSIGN(StartInterceptor); 44 DISALLOW_COPY_AND_ASSIGN(StartInterceptor);
32 }; 45 };
33 46
34 47
35 // static 48 // static
36 AppCacheInterceptor* AppCacheInterceptor::GetInstance() { 49 AppCacheInterceptor* AppCacheInterceptor::GetInstance() {
37 return Singleton<AppCacheInterceptor>::get(); 50 return Singleton<AppCacheInterceptor>::get();
38 } 51 }
39 52
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 152
140 net::URLRequestJob* AppCacheInterceptor::MaybeInterceptResponse( 153 net::URLRequestJob* AppCacheInterceptor::MaybeInterceptResponse(
141 net::URLRequest* request, net::NetworkDelegate* network_delegate) { 154 net::URLRequest* request, net::NetworkDelegate* network_delegate) {
142 AppCacheRequestHandler* handler = GetHandler(request); 155 AppCacheRequestHandler* handler = GetHandler(request);
143 if (!handler) 156 if (!handler)
144 return NULL; 157 return NULL;
145 return handler->MaybeLoadFallbackForResponse(request, network_delegate); 158 return handler->MaybeLoadFallbackForResponse(request, network_delegate);
146 } 159 }
147 160
148 } // namespace content 161 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698