| 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(
|
|
|