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/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
9 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
10 #include "content/public/common/resource_type.h" | 12 #include "content/public/common/resource_type.h" |
11 #include "net/url_request/url_request_interceptor.h" | 13 #include "net/url_request/url_request_interceptor.h" |
12 | 14 |
13 class GURL; | 15 class GURL; |
14 | 16 |
15 namespace net { | 17 namespace net { |
16 class URLRequest; | 18 class URLRequest; |
17 } | 19 } |
18 | 20 |
19 namespace content { | 21 namespace content { |
20 class AppCacheRequestHandler; | 22 class AppCacheRequestHandler; |
21 class AppCacheServiceImpl; | 23 class AppCacheServiceImpl; |
22 | 24 |
23 // An interceptor to hijack requests and potentially service them out of | 25 // An interceptor to hijack requests and potentially service them out of |
24 // the appcache. | 26 // the appcache. |
25 class CONTENT_EXPORT AppCacheInterceptor : public net::URLRequestInterceptor { | 27 class CONTENT_EXPORT AppCacheInterceptor : public net::URLRequestInterceptor { |
26 public: | 28 public: |
27 // Must be called to make a request eligible for retrieval from an appcache. | 29 // Must be called to make a request eligible for retrieval from an appcache. |
28 static void SetExtraRequestInfo(net::URLRequest* request, | 30 static void SetExtraRequestInfo(net::URLRequest* request, |
29 AppCacheServiceImpl* service, | 31 AppCacheServiceImpl* service, |
30 int process_id, | 32 int process_id, |
31 int host_id, | 33 int host_id, |
32 ResourceType resource_type, | 34 ResourceType resource_type, |
33 bool should_reset_appcache); | 35 bool should_reset_appcache); |
34 | 36 |
35 // May be called after response headers are complete to retrieve extra | 37 // May be called after response headers are complete to retrieve extra |
36 // info about the response. | 38 // info about the response. |
37 static void GetExtraResponseInfo(net::URLRequest* request, | 39 static void GetExtraResponseInfo(net::URLRequest* request, |
38 int64* cache_id, | 40 int64_t* cache_id, |
39 GURL* manifest_url); | 41 GURL* manifest_url); |
40 | 42 |
41 // Methods to support cross site navigations. | 43 // Methods to support cross site navigations. |
42 static void PrepareForCrossSiteTransfer(net::URLRequest* request, | 44 static void PrepareForCrossSiteTransfer(net::URLRequest* request, |
43 int old_process_id); | 45 int old_process_id); |
44 static void CompleteCrossSiteTransfer(net::URLRequest* request, | 46 static void CompleteCrossSiteTransfer(net::URLRequest* request, |
45 int new_process_id, | 47 int new_process_id, |
46 int new_host_id); | 48 int new_host_id); |
47 static void MaybeCompleteCrossSiteTransferInOldProcess( | 49 static void MaybeCompleteCrossSiteTransferInOldProcess( |
48 net::URLRequest* request, | 50 net::URLRequest* request, |
(...skipping 19 matching lines...) Expand all Loading... |
68 static void SetHandler(net::URLRequest* request, | 70 static void SetHandler(net::URLRequest* request, |
69 AppCacheRequestHandler* handler); | 71 AppCacheRequestHandler* handler); |
70 static AppCacheRequestHandler* GetHandler(net::URLRequest* request); | 72 static AppCacheRequestHandler* GetHandler(net::URLRequest* request); |
71 | 73 |
72 DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); | 74 DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); |
73 }; | 75 }; |
74 | 76 |
75 } // namespace content | 77 } // namespace content |
76 | 78 |
77 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ | 79 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_INTERCEPTOR_H_ |
OLD | NEW |