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