| 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_GROUP_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ |
| 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/cancelable_callback.h" | 11 #include "base/cancelable_callback.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "content/common/content_export.h" |
| 17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 18 #include "webkit/browser/webkit_storage_browser_export.h" | |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 FORWARD_DECLARE_TEST(AppCacheGroupTest, StartUpdate); | 21 FORWARD_DECLARE_TEST(AppCacheGroupTest, StartUpdate); |
| 22 FORWARD_DECLARE_TEST(AppCacheGroupTest, CancelUpdate); | 22 FORWARD_DECLARE_TEST(AppCacheGroupTest, CancelUpdate); |
| 23 FORWARD_DECLARE_TEST(AppCacheGroupTest, QueueUpdate); | 23 FORWARD_DECLARE_TEST(AppCacheGroupTest, QueueUpdate); |
| 24 FORWARD_DECLARE_TEST(AppCacheUpdateJobTest, AlreadyChecking); | 24 FORWARD_DECLARE_TEST(AppCacheUpdateJobTest, AlreadyChecking); |
| 25 FORWARD_DECLARE_TEST(AppCacheUpdateJobTest, AlreadyDownloading); | 25 FORWARD_DECLARE_TEST(AppCacheUpdateJobTest, AlreadyDownloading); |
| 26 class AppCacheUpdateJobTest; | 26 class AppCacheUpdateJobTest; |
| 27 class MockAppCacheStorage; | 27 class MockAppCacheStorage; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace appcache { | 30 namespace content { |
| 31 | 31 |
| 32 class AppCache; | 32 class AppCache; |
| 33 class AppCacheHost; | 33 class AppCacheHost; |
| 34 class AppCacheStorage; | 34 class AppCacheStorage; |
| 35 class AppCacheUpdateJob; | 35 class AppCacheUpdateJob; |
| 36 class HostObserver; | 36 class HostObserver; |
| 37 | 37 |
| 38 // Collection of application caches identified by the same manifest URL. | 38 // Collection of application caches identified by the same manifest URL. |
| 39 // A group exists as long as it is in use by a host or is being updated. | 39 // A group exists as long as it is in use by a host or is being updated. |
| 40 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheGroup | 40 class CONTENT_EXPORT AppCacheGroup |
| 41 : public base::RefCounted<AppCacheGroup> { | 41 : public base::RefCounted<AppCacheGroup> { |
| 42 public: | 42 public: |
| 43 | 43 |
| 44 class WEBKIT_STORAGE_BROWSER_EXPORT UpdateObserver { | 44 class CONTENT_EXPORT UpdateObserver { |
| 45 public: | 45 public: |
| 46 // Called just after an appcache update has completed. | 46 // Called just after an appcache update has completed. |
| 47 virtual void OnUpdateComplete(AppCacheGroup* group) = 0; | 47 virtual void OnUpdateComplete(AppCacheGroup* group) = 0; |
| 48 virtual ~UpdateObserver() {} | 48 virtual ~UpdateObserver() {} |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 enum UpdateAppCacheStatus { | 51 enum UpdateAppCacheStatus { |
| 52 IDLE, | 52 IDLE, |
| 53 CHECKING, | 53 CHECKING, |
| 54 DOWNLOADING, | 54 DOWNLOADING, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, StartUpdate); | 166 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, StartUpdate); |
| 167 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, CancelUpdate); | 167 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, CancelUpdate); |
| 168 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); | 168 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); |
| 169 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyChecking); | 169 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyChecking); |
| 170 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyDownloading); | 170 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyDownloading); |
| 171 | 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(AppCacheGroup); | 172 DISALLOW_COPY_AND_ASSIGN(AppCacheGroup); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 } // namespace appcache | 175 } // namespace content |
| 176 | 176 |
| 177 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ | 177 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ |
| OLD | NEW |