OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "webkit/appcache/appcache_interceptor.h" | 5 #include "webkit/appcache/appcache_interceptor.h" |
6 | 6 |
7 #include "webkit/appcache/appcache_backend_impl.h" | 7 #include "webkit/appcache/appcache_backend_impl.h" |
8 #include "webkit/appcache/appcache_host.h" | 8 #include "webkit/appcache/appcache_host.h" |
9 #include "webkit/appcache/appcache_interfaces.h" | 9 #include "webkit/appcache/appcache_interfaces.h" |
10 #include "webkit/appcache/appcache_request_handler.h" | 10 #include "webkit/appcache/appcache_request_handler.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 AppCacheInterceptor::AppCacheInterceptor() { | 60 AppCacheInterceptor::AppCacheInterceptor() { |
61 net::URLRequest::RegisterRequestInterceptor(this); | 61 net::URLRequest::RegisterRequestInterceptor(this); |
62 } | 62 } |
63 | 63 |
64 AppCacheInterceptor::~AppCacheInterceptor() { | 64 AppCacheInterceptor::~AppCacheInterceptor() { |
65 net::URLRequest::UnregisterRequestInterceptor(this); | 65 net::URLRequest::UnregisterRequestInterceptor(this); |
66 } | 66 } |
67 | 67 |
68 URLRequestJob* AppCacheInterceptor::MaybeIntercept(net::URLRequest* request) { | 68 net::URLRequestJob* AppCacheInterceptor::MaybeIntercept( |
| 69 net::URLRequest* request) { |
69 AppCacheRequestHandler* handler = GetHandler(request); | 70 AppCacheRequestHandler* handler = GetHandler(request); |
70 if (!handler) | 71 if (!handler) |
71 return NULL; | 72 return NULL; |
72 return handler->MaybeLoadResource(request); | 73 return handler->MaybeLoadResource(request); |
73 } | 74 } |
74 | 75 |
75 URLRequestJob* AppCacheInterceptor::MaybeInterceptRedirect( | 76 net::URLRequestJob* AppCacheInterceptor::MaybeInterceptRedirect( |
76 net::URLRequest* request, | 77 net::URLRequest* request, |
77 const GURL& location) { | 78 const GURL& location) { |
78 AppCacheRequestHandler* handler = GetHandler(request); | 79 AppCacheRequestHandler* handler = GetHandler(request); |
79 if (!handler) | 80 if (!handler) |
80 return NULL; | 81 return NULL; |
81 return handler->MaybeLoadFallbackForRedirect(request, location); | 82 return handler->MaybeLoadFallbackForRedirect(request, location); |
82 } | 83 } |
83 | 84 |
84 URLRequestJob* AppCacheInterceptor::MaybeInterceptResponse( | 85 net::URLRequestJob* AppCacheInterceptor::MaybeInterceptResponse( |
85 net::URLRequest* request) { | 86 net::URLRequest* request) { |
86 AppCacheRequestHandler* handler = GetHandler(request); | 87 AppCacheRequestHandler* handler = GetHandler(request); |
87 if (!handler) | 88 if (!handler) |
88 return NULL; | 89 return NULL; |
89 return handler->MaybeLoadFallbackForResponse(request); | 90 return handler->MaybeLoadFallbackForResponse(request); |
90 } | 91 } |
91 | 92 |
92 } // namespace appcache | 93 } // namespace appcache |
OLD | NEW |