| 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_REQUEST_HANDLER_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
| 6 #define WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "net/url_request/url_request.h" | 9 #include "base/supports_user_data.h" |
| 10 #include "webkit/appcache/appcache_entry.h" | 10 #include "webkit/appcache/appcache_entry.h" |
| 11 #include "webkit/appcache/appcache_export.h" | 11 #include "webkit/appcache/appcache_export.h" |
| 12 #include "webkit/appcache/appcache_host.h" | 12 #include "webkit/appcache/appcache_host.h" |
| 13 #include "webkit/glue/resource_type.h" | 13 #include "webkit/glue/resource_type.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 class URLRequest; | 16 class URLRequest; |
| 17 class URLRequestJob; | 17 class URLRequestJob; |
| 18 } // namespace net | 18 } // namespace net |
| 19 | 19 |
| 20 namespace appcache { | 20 namespace appcache { |
| 21 | 21 |
| 22 class AppCacheURLRequestJob; | 22 class AppCacheURLRequestJob; |
| 23 | 23 |
| 24 // An instance is created for each net::URLRequest. The instance survives all | 24 // An instance is created for each net::URLRequest. The instance survives all |
| 25 // http transactions involved in the processing of its net::URLRequest, and is | 25 // http transactions involved in the processing of its net::URLRequest, and is |
| 26 // given the opportunity to hijack the request along the way. Callers | 26 // given the opportunity to hijack the request along the way. Callers |
| 27 // should use AppCacheHost::CreateRequestHandler to manufacture instances | 27 // should use AppCacheHost::CreateRequestHandler to manufacture instances |
| 28 // that can retrieve resources for a particular host. | 28 // that can retrieve resources for a particular host. |
| 29 class APPCACHE_EXPORT AppCacheRequestHandler | 29 class APPCACHE_EXPORT AppCacheRequestHandler |
| 30 : NON_EXPORTED_BASE(public net::URLRequest::UserData), | 30 : public base::SupportsUserData::Data, |
| 31 public AppCacheHost::Observer, | 31 public AppCacheHost::Observer, |
| 32 public AppCacheStorage::Delegate { | 32 public AppCacheStorage::Delegate { |
| 33 public: | 33 public: |
| 34 virtual ~AppCacheRequestHandler(); | 34 virtual ~AppCacheRequestHandler(); |
| 35 | 35 |
| 36 // These are called on each request intercept opportunity. | 36 // These are called on each request intercept opportunity. |
| 37 AppCacheURLRequestJob* MaybeLoadResource(net::URLRequest* request); | 37 AppCacheURLRequestJob* MaybeLoadResource(net::URLRequest* request); |
| 38 AppCacheURLRequestJob* MaybeLoadFallbackForRedirect(net::URLRequest* request, | 38 AppCacheURLRequestJob* MaybeLoadFallbackForRedirect(net::URLRequest* request, |
| 39 const GURL& location); | 39 const GURL& location); |
| 40 AppCacheURLRequestJob* MaybeLoadFallbackForResponse(net::URLRequest* request); | 40 AppCacheURLRequestJob* MaybeLoadFallbackForResponse(net::URLRequest* request); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // The job we use to deliver a response. | 121 // The job we use to deliver a response. |
| 122 scoped_refptr<AppCacheURLRequestJob> job_; | 122 scoped_refptr<AppCacheURLRequestJob> job_; |
| 123 | 123 |
| 124 friend class AppCacheRequestHandlerTest; | 124 friend class AppCacheRequestHandlerTest; |
| 125 DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler); | 125 DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace appcache | 128 } // namespace appcache |
| 129 | 129 |
| 130 #endif // WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ | 130 #endif // WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
| OLD | NEW |