| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_HOST_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_HOST_H_ |
| 6 #define WEBKIT_APPCACHE_APPCACHE_HOST_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_HOST_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "webkit/appcache/appcache_group.h" | 13 #include "webkit/appcache/appcache_group.h" |
| 14 #include "webkit/appcache/appcache_interfaces.h" | 14 #include "webkit/appcache/appcache_interfaces.h" |
| 15 #include "webkit/appcache/appcache_service.h" | 15 #include "webkit/appcache/appcache_service.h" |
| 16 #include "webkit/appcache/appcache_storage.h" | 16 #include "webkit/appcache/appcache_storage.h" |
| 17 #include "webkit/glue/resource_type.h" | 17 #include "webkit/glue/resource_type.h" |
| 18 | 18 |
| 19 namespace net { |
| 19 class URLRequest; | 20 class URLRequest; |
| 21 } // namespace net |
| 20 | 22 |
| 21 namespace appcache { | 23 namespace appcache { |
| 22 | 24 |
| 23 class AppCache; | 25 class AppCache; |
| 24 class AppCacheFrontend; | 26 class AppCacheFrontend; |
| 25 class AppCacheRequestHandler; | 27 class AppCacheRequestHandler; |
| 26 | 28 |
| 27 typedef Callback2<Status, void*>::Type GetStatusCallback; | 29 typedef Callback2<Status, void*>::Type GetStatusCallback; |
| 28 typedef Callback2<bool, void*>::Type StartUpdateCallback; | 30 typedef Callback2<bool, void*>::Type StartUpdateCallback; |
| 29 typedef Callback2<bool, void*>::Type SwapCacheCallback; | 31 typedef Callback2<bool, void*>::Type SwapCacheCallback; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void GetStatusWithCallback(GetStatusCallback* callback, | 67 void GetStatusWithCallback(GetStatusCallback* callback, |
| 66 void* callback_param); | 68 void* callback_param); |
| 67 void StartUpdateWithCallback(StartUpdateCallback* callback, | 69 void StartUpdateWithCallback(StartUpdateCallback* callback, |
| 68 void* callback_param); | 70 void* callback_param); |
| 69 void SwapCacheWithCallback(SwapCacheCallback* callback, | 71 void SwapCacheWithCallback(SwapCacheCallback* callback, |
| 70 void* callback_param); | 72 void* callback_param); |
| 71 | 73 |
| 72 // Support for loading resources out of the appcache. | 74 // Support for loading resources out of the appcache. |
| 73 // May return NULL if the request isn't subject to retrieval from an appache. | 75 // May return NULL if the request isn't subject to retrieval from an appache. |
| 74 AppCacheRequestHandler* CreateRequestHandler( | 76 AppCacheRequestHandler* CreateRequestHandler( |
| 75 URLRequest* request, ResourceType::Type resource_type); | 77 net::URLRequest* request, ResourceType::Type resource_type); |
| 76 | 78 |
| 77 // Support for devtools inspecting appcache resources. | 79 // Support for devtools inspecting appcache resources. |
| 78 void GetResourceList(std::vector<AppCacheResourceInfo>* resource_infos); | 80 void GetResourceList(std::vector<AppCacheResourceInfo>* resource_infos); |
| 79 | 81 |
| 80 // Establishes an association between this host and a cache. 'cache' may be | 82 // Establishes an association between this host and a cache. 'cache' may be |
| 81 // NULL to break any existing association. Associations are established | 83 // NULL to break any existing association. Associations are established |
| 82 // either thru the cache selection algorithm implemented (in this class), | 84 // either thru the cache selection algorithm implemented (in this class), |
| 83 // or by the update algorithm (see AppCacheUpdateJob). | 85 // or by the update algorithm (see AppCacheUpdateJob). |
| 84 void AssociateCache(AppCache* cache); | 86 void AssociateCache(AppCache* cache); |
| 85 | 87 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SetSwappableCache); | 231 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SetSwappableCache); |
| 230 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, ForDedicatedWorker); | 232 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, ForDedicatedWorker); |
| 231 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); | 233 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); |
| 232 | 234 |
| 233 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); | 235 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); |
| 234 }; | 236 }; |
| 235 | 237 |
| 236 } // namespace appcache | 238 } // namespace appcache |
| 237 | 239 |
| 238 #endif // WEBKIT_APPCACHE_APPCACHE_HOST_H_ | 240 #endif // WEBKIT_APPCACHE_APPCACHE_HOST_H_ |
| OLD | NEW |