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_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "webkit/browser/appcache/appcache_entry.h" | 10 #include "content/browser/appcache/appcache_entry.h" |
11 #include "webkit/browser/appcache/appcache_host.h" | 11 #include "content/browser/appcache/appcache_host.h" |
12 #include "webkit/browser/webkit_storage_browser_export.h" | 12 #include "content/common/content_export.h" |
13 #include "webkit/common/resource_type.h" | 13 #include "webkit/common/resource_type.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 class NetworkDelegate; | 16 class NetworkDelegate; |
17 class URLRequest; | 17 class URLRequest; |
18 class URLRequestJob; | 18 class URLRequestJob; |
19 } // namespace net | 19 } // namespace net |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class AppCacheRequestHandlerTest; | 22 class AppCacheRequestHandlerTest; |
23 } | 23 } |
24 | 24 |
25 namespace appcache { | 25 namespace content { |
26 | 26 |
27 class AppCacheURLRequestJob; | 27 class AppCacheURLRequestJob; |
28 | 28 |
29 // An instance is created for each net::URLRequest. The instance survives all | 29 // An instance is created for each net::URLRequest. The instance survives all |
30 // http transactions involved in the processing of its net::URLRequest, and is | 30 // http transactions involved in the processing of its net::URLRequest, and is |
31 // given the opportunity to hijack the request along the way. Callers | 31 // given the opportunity to hijack the request along the way. Callers |
32 // should use AppCacheHost::CreateRequestHandler to manufacture instances | 32 // should use AppCacheHost::CreateRequestHandler to manufacture instances |
33 // that can retrieve resources for a particular host. | 33 // that can retrieve resources for a particular host. |
34 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheRequestHandler | 34 class CONTENT_EXPORT AppCacheRequestHandler |
35 : public base::SupportsUserData::Data, | 35 : public base::SupportsUserData::Data, |
36 public AppCacheHost::Observer, | 36 public AppCacheHost::Observer, |
37 public AppCacheStorage::Delegate { | 37 public AppCacheStorage::Delegate { |
38 public: | 38 public: |
39 virtual ~AppCacheRequestHandler(); | 39 virtual ~AppCacheRequestHandler(); |
40 | 40 |
41 // These are called on each request intercept opportunity. | 41 // These are called on each request intercept opportunity. |
42 AppCacheURLRequestJob* MaybeLoadResource( | 42 AppCacheURLRequestJob* MaybeLoadResource( |
43 net::URLRequest* request, net::NetworkDelegate* network_delegate); | 43 net::URLRequest* request, net::NetworkDelegate* network_delegate); |
44 AppCacheURLRequestJob* MaybeLoadFallbackForRedirect( | 44 AppCacheURLRequestJob* MaybeLoadFallbackForRedirect( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 scoped_refptr<AppCacheURLRequestJob> job_; | 140 scoped_refptr<AppCacheURLRequestJob> job_; |
141 | 141 |
142 // During a cross site navigation, we transfer ownership the AppcacheHost | 142 // During a cross site navigation, we transfer ownership the AppcacheHost |
143 // from the old processes structures over to the new structures. | 143 // from the old processes structures over to the new structures. |
144 scoped_ptr<AppCacheHost> host_for_cross_site_transfer_; | 144 scoped_ptr<AppCacheHost> host_for_cross_site_transfer_; |
145 | 145 |
146 friend class content::AppCacheRequestHandlerTest; | 146 friend class content::AppCacheRequestHandlerTest; |
147 DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler); | 147 DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler); |
148 }; | 148 }; |
149 | 149 |
150 } // namespace appcache | 150 } // namespace content |
151 | 151 |
152 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ | 152 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
OLD | NEW |