OLD | NEW |
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 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
7 | 7 |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/common/resource_type.h" | 10 #include "content/public/common/resource_type.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // The appcache system employs two different interceptors. The singleton | 52 // The appcache system employs two different interceptors. The singleton |
53 // AppCacheInterceptor derives URLRequest::Interceptor and is used | 53 // AppCacheInterceptor derives URLRequest::Interceptor and is used |
54 // to hijack request handling upon receipt of the response or a redirect. | 54 // to hijack request handling upon receipt of the response or a redirect. |
55 // A separate URLRequestInterceptor derivative is used to hijack handling | 55 // A separate URLRequestInterceptor derivative is used to hijack handling |
56 // at the very start of request processing. The separate handler allows the | 56 // at the very start of request processing. The separate handler allows the |
57 // content lib to order its collection of net::URLRequestInterceptors. | 57 // content lib to order its collection of net::URLRequestInterceptors. |
58 static scoped_ptr<net::URLRequestInterceptor> CreateStartInterceptor(); | 58 static scoped_ptr<net::URLRequestInterceptor> CreateStartInterceptor(); |
59 | 59 |
60 protected: | 60 protected: |
61 // Override from net::URLRequest::Interceptor: | 61 // Override from net::URLRequest::Interceptor: |
62 virtual net::URLRequestJob* MaybeIntercept( | 62 net::URLRequestJob* MaybeIntercept( |
63 net::URLRequest* request, | 63 net::URLRequest* request, |
64 net::NetworkDelegate* network_delegate) override; | 64 net::NetworkDelegate* network_delegate) override; |
65 virtual net::URLRequestJob* MaybeInterceptResponse( | 65 net::URLRequestJob* MaybeInterceptResponse( |
66 net::URLRequest* request, | 66 net::URLRequest* request, |
67 net::NetworkDelegate* network_delegate) override; | 67 net::NetworkDelegate* network_delegate) override; |
68 virtual net::URLRequestJob* MaybeInterceptRedirect( | 68 net::URLRequestJob* MaybeInterceptRedirect( |
69 net::URLRequest* request, | 69 net::URLRequest* request, |
70 net::NetworkDelegate* network_delegate, | 70 net::NetworkDelegate* network_delegate, |
71 const GURL& location) override; | 71 const GURL& location) override; |
72 | 72 |
73 private: | 73 private: |
74 friend struct DefaultSingletonTraits<AppCacheInterceptor>; | 74 friend struct DefaultSingletonTraits<AppCacheInterceptor>; |
75 class StartInterceptor; | 75 class StartInterceptor; |
76 | 76 |
77 AppCacheInterceptor(); | 77 AppCacheInterceptor(); |
78 virtual ~AppCacheInterceptor(); | 78 ~AppCacheInterceptor() override; |
79 | 79 |
80 static void SetHandler(net::URLRequest* request, | 80 static void SetHandler(net::URLRequest* request, |
81 AppCacheRequestHandler* handler); | 81 AppCacheRequestHandler* handler); |
82 static AppCacheRequestHandler* GetHandler(net::URLRequest* request); | 82 static AppCacheRequestHandler* GetHandler(net::URLRequest* request); |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); | 84 DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace content | 87 } // namespace content |
88 | 88 |
89 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 89 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
OLD | NEW |