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_GROUP_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_GROUP_H_ |
6 #define WEBKIT_APPCACHE_APPCACHE_GROUP_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_GROUP_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class AppCacheUpdateJob; | 23 class AppCacheUpdateJob; |
24 class HostObserver; | 24 class HostObserver; |
25 | 25 |
26 // Collection of application caches identified by the same manifest URL. | 26 // Collection of application caches identified by the same manifest URL. |
27 // A group exists as long as it is in use by a host or is being updated. | 27 // A group exists as long as it is in use by a host or is being updated. |
28 class AppCacheGroup : public base::RefCounted<AppCacheGroup> { | 28 class AppCacheGroup : public base::RefCounted<AppCacheGroup> { |
29 public: | 29 public: |
30 | 30 |
31 class UpdateObserver { | 31 class UpdateObserver { |
32 public: | 32 public: |
33 // Called if access to the appcache was blocked by a policy. | |
34 virtual void OnContentBlocked(AppCacheGroup* group) = 0; | |
35 | |
36 // Called just after an appcache update has completed. | 33 // Called just after an appcache update has completed. |
37 virtual void OnUpdateComplete(AppCacheGroup* group) = 0; | 34 virtual void OnUpdateComplete(AppCacheGroup* group) = 0; |
38 virtual ~UpdateObserver() {} | 35 virtual ~UpdateObserver() {} |
39 }; | 36 }; |
40 | 37 |
41 enum UpdateStatus { | 38 enum UpdateStatus { |
42 IDLE, | 39 IDLE, |
43 CHECKING, | 40 CHECKING, |
44 DOWNLOADING, | 41 DOWNLOADING, |
45 }; | 42 }; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); | 155 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); |
159 FRIEND_TEST_ALL_PREFIXES(AppCacheUpdateJobTest, AlreadyChecking); | 156 FRIEND_TEST_ALL_PREFIXES(AppCacheUpdateJobTest, AlreadyChecking); |
160 FRIEND_TEST_ALL_PREFIXES(AppCacheUpdateJobTest, AlreadyDownloading); | 157 FRIEND_TEST_ALL_PREFIXES(AppCacheUpdateJobTest, AlreadyDownloading); |
161 | 158 |
162 DISALLOW_COPY_AND_ASSIGN(AppCacheGroup); | 159 DISALLOW_COPY_AND_ASSIGN(AppCacheGroup); |
163 }; | 160 }; |
164 | 161 |
165 } // namespace appcache | 162 } // namespace appcache |
166 | 163 |
167 #endif // WEBKIT_APPCACHE_APPCACHE_GROUP_H_ | 164 #endif // WEBKIT_APPCACHE_APPCACHE_GROUP_H_ |
OLD | NEW |