| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef WEBKIT_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
| 6 #define WEBKIT_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // May be called after response headers are complete to retrieve extra | 37 // May be called after response headers are complete to retrieve extra |
| 38 // info about the response. | 38 // info about the response. |
| 39 static void GetExtraResponseInfo(net::URLRequest* request, | 39 static void GetExtraResponseInfo(net::URLRequest* request, |
| 40 int64* cache_id, | 40 int64* cache_id, |
| 41 GURL* manifest_url); | 41 GURL* manifest_url); |
| 42 | 42 |
| 43 static AppCacheInterceptor* GetInstance(); | 43 static AppCacheInterceptor* GetInstance(); |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 // Override from net::URLRequest::Interceptor: | 46 // Override from net::URLRequest::Interceptor: |
| 47 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) OVERRIDE; | 47 virtual net::URLRequestJob* MaybeIntercept( |
| 48 net::URLRequest* request, |
| 49 net::NetworkDelegate* network_delegate) OVERRIDE; |
| 48 virtual net::URLRequestJob* MaybeInterceptResponse( | 50 virtual net::URLRequestJob* MaybeInterceptResponse( |
| 49 net::URLRequest* request) OVERRIDE; | 51 net::URLRequest* request, |
| 52 net::NetworkDelegate* network_delegate) OVERRIDE; |
| 50 virtual net::URLRequestJob* MaybeInterceptRedirect( | 53 virtual net::URLRequestJob* MaybeInterceptRedirect( |
| 51 net::URLRequest* request, | 54 net::URLRequest* request, |
| 55 net::NetworkDelegate* network_delegate, |
| 52 const GURL& location) OVERRIDE; | 56 const GURL& location) OVERRIDE; |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 friend struct DefaultSingletonTraits<AppCacheInterceptor>; | 59 friend struct DefaultSingletonTraits<AppCacheInterceptor>; |
| 56 | 60 |
| 57 AppCacheInterceptor(); | 61 AppCacheInterceptor(); |
| 58 virtual ~AppCacheInterceptor(); | 62 virtual ~AppCacheInterceptor(); |
| 59 | 63 |
| 60 static void SetHandler(net::URLRequest* request, | 64 static void SetHandler(net::URLRequest* request, |
| 61 AppCacheRequestHandler* handler); | 65 AppCacheRequestHandler* handler); |
| 62 static AppCacheRequestHandler* GetHandler(net::URLRequest* request); | 66 static AppCacheRequestHandler* GetHandler(net::URLRequest* request); |
| 63 | 67 |
| 64 DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); | 68 DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace appcache | 71 } // namespace appcache |
| 68 | 72 |
| 69 #endif // WEBKIT_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 73 #endif // WEBKIT_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
| OLD | NEW |