| 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_HOST_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ |
| 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ | 6 #define WEBKIT_BROWSER_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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 class AppCacheRequestHandlerTest; | 41 class AppCacheRequestHandlerTest; |
| 42 class AppCacheUpdateJobTest; | 42 class AppCacheUpdateJobTest; |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace appcache { | 45 namespace appcache { |
| 46 | 46 |
| 47 class AppCache; | 47 class AppCache; |
| 48 class AppCacheFrontend; | 48 class AppCacheFrontend; |
| 49 class AppCacheRequestHandler; | 49 class AppCacheRequestHandler; |
| 50 | 50 |
| 51 typedef base::Callback<void(Status, void*)> GetStatusCallback; | 51 typedef base::Callback<void(AppCacheStatus, void*)> GetStatusCallback; |
| 52 typedef base::Callback<void(bool, void*)> StartUpdateCallback; | 52 typedef base::Callback<void(bool, void*)> StartUpdateCallback; |
| 53 typedef base::Callback<void(bool, void*)> SwapCacheCallback; | 53 typedef base::Callback<void(bool, void*)> SwapCacheCallback; |
| 54 | 54 |
| 55 // Server-side representation of an application cache host. | 55 // Server-side representation of an application cache host. |
| 56 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheHost | 56 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheHost |
| 57 : public AppCacheStorage::Delegate, | 57 : public AppCacheStorage::Delegate, |
| 58 public AppCacheGroup::UpdateObserver, | 58 public AppCacheGroup::UpdateObserver, |
| 59 public AppCacheServiceImpl::Observer { | 59 public AppCacheServiceImpl::Observer { |
| 60 public: | 60 public: |
| 61 | 61 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // Methods to support cross site navigations. | 176 // Methods to support cross site navigations. |
| 177 void PrepareForTransfer(); | 177 void PrepareForTransfer(); |
| 178 void CompleteTransfer(int host_id, AppCacheFrontend* frontend); | 178 void CompleteTransfer(int host_id, AppCacheFrontend* frontend); |
| 179 | 179 |
| 180 private: | 180 private: |
| 181 friend class content::AppCacheHostTest; | 181 friend class content::AppCacheHostTest; |
| 182 friend class content::AppCacheStorageImplTest; | 182 friend class content::AppCacheStorageImplTest; |
| 183 friend class content::AppCacheRequestHandlerTest; | 183 friend class content::AppCacheRequestHandlerTest; |
| 184 friend class content::AppCacheUpdateJobTest; | 184 friend class content::AppCacheUpdateJobTest; |
| 185 | 185 |
| 186 Status GetStatus(); | 186 AppCacheStatus GetStatus(); |
| 187 void LoadSelectedCache(int64 cache_id); | 187 void LoadSelectedCache(int64 cache_id); |
| 188 void LoadOrCreateGroup(const GURL& manifest_url); | 188 void LoadOrCreateGroup(const GURL& manifest_url); |
| 189 | 189 |
| 190 // See public Associate*Host() methods above. | 190 // See public Associate*Host() methods above. |
| 191 void AssociateCacheHelper(AppCache* cache, const GURL& manifest_url); | 191 void AssociateCacheHelper(AppCache* cache, const GURL& manifest_url); |
| 192 | 192 |
| 193 // AppCacheStorage::Delegate impl | 193 // AppCacheStorage::Delegate impl |
| 194 virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) OVERRIDE; | 194 virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) OVERRIDE; |
| 195 virtual void OnGroupLoaded(AppCacheGroup* group, | 195 virtual void OnGroupLoaded(AppCacheGroup* group, |
| 196 const GURL& manifest_url) OVERRIDE; | 196 const GURL& manifest_url) OVERRIDE; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheAllowed); | 329 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheAllowed); |
| 330 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheBlocked); | 330 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheBlocked); |
| 331 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, CleanupUnusedCache); | 331 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, CleanupUnusedCache); |
| 332 | 332 |
| 333 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); | 333 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); |
| 334 }; | 334 }; |
| 335 | 335 |
| 336 } // namespace appcache | 336 } // namespace appcache |
| 337 | 337 |
| 338 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ | 338 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ |
| OLD | NEW |