Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: content/browser/appcache/appcache_group.h

Issue 1162943002: Replace more ObserverList with base::ObserverList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observer
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_
6 #define CONTENT_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
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 AppCacheUpdateJob* update_job() { return update_job_; } 115 AppCacheUpdateJob* update_job() { return update_job_; }
116 void SetUpdateAppCacheStatus(UpdateAppCacheStatus status); 116 void SetUpdateAppCacheStatus(UpdateAppCacheStatus status);
117 117
118 void NotifyContentBlocked(); 118 void NotifyContentBlocked();
119 119
120 const Caches& old_caches() const { return old_caches_; } 120 const Caches& old_caches() const { return old_caches_; }
121 121
122 // Update cannot be processed at this time. Queue it for a later run. 122 // Update cannot be processed at this time. Queue it for a later run.
123 void QueueUpdate(AppCacheHost* host, const GURL& new_master_resource); 123 void QueueUpdate(AppCacheHost* host, const GURL& new_master_resource);
124 void RunQueuedUpdates(); 124 void RunQueuedUpdates();
125 static bool FindObserver(const UpdateObserver* find_me, 125 static bool FindObserver(
126 const ObserverList<UpdateObserver>& observer_list); 126 const UpdateObserver* find_me,
127 const base::ObserverList<UpdateObserver>& observer_list);
127 void ScheduleUpdateRestart(int delay_ms); 128 void ScheduleUpdateRestart(int delay_ms);
128 void HostDestructionImminent(AppCacheHost* host); 129 void HostDestructionImminent(AppCacheHost* host);
129 130
130 const int64 group_id_; 131 const int64 group_id_;
131 const GURL manifest_url_; 132 const GURL manifest_url_;
132 base::Time creation_time_; 133 base::Time creation_time_;
133 UpdateAppCacheStatus update_status_; 134 UpdateAppCacheStatus update_status_;
134 bool is_obsolete_; 135 bool is_obsolete_;
135 bool is_being_deleted_; 136 bool is_being_deleted_;
136 std::vector<int64> newly_deletable_response_ids_; 137 std::vector<int64> newly_deletable_response_ids_;
137 138
138 // Old complete app caches. 139 // Old complete app caches.
139 Caches old_caches_; 140 Caches old_caches_;
140 141
141 // Newest cache in this group to be complete, aka relevant cache. 142 // Newest cache in this group to be complete, aka relevant cache.
142 AppCache* newest_complete_cache_; 143 AppCache* newest_complete_cache_;
143 144
144 // Current update job for this group, if any. 145 // Current update job for this group, if any.
145 AppCacheUpdateJob* update_job_; 146 AppCacheUpdateJob* update_job_;
146 147
147 // Central storage object. 148 // Central storage object.
148 AppCacheStorage* storage_; 149 AppCacheStorage* storage_;
149 150
150 // List of objects observing this group. 151 // List of objects observing this group.
151 ObserverList<UpdateObserver> observers_; 152 base::ObserverList<UpdateObserver> observers_;
152 153
153 // Updates that have been queued for the next run. 154 // Updates that have been queued for the next run.
154 QueuedUpdates queued_updates_; 155 QueuedUpdates queued_updates_;
155 ObserverList<UpdateObserver> queued_observers_; 156 base::ObserverList<UpdateObserver> queued_observers_;
156 base::CancelableClosure restart_update_task_; 157 base::CancelableClosure restart_update_task_;
157 scoped_ptr<HostObserver> host_observer_; 158 scoped_ptr<HostObserver> host_observer_;
158 159
159 // True if we're in our destructor. 160 // True if we're in our destructor.
160 bool is_in_dtor_; 161 bool is_in_dtor_;
161 162
162 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, StartUpdate); 163 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, StartUpdate);
163 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, CancelUpdate); 164 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, CancelUpdate);
164 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); 165 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate);
165 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyChecking); 166 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyChecking);
166 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyDownloading); 167 FRIEND_TEST_ALL_PREFIXES(content::AppCacheUpdateJobTest, AlreadyDownloading);
167 168
168 DISALLOW_COPY_AND_ASSIGN(AppCacheGroup); 169 DISALLOW_COPY_AND_ASSIGN(AppCacheGroup);
169 }; 170 };
170 171
171 } // namespace content 172 } // namespace content
172 173
173 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ 174 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_
OLDNEW
« no previous file with comments | « content/browser/android/in_process/synchronous_compositor_factory_impl.cc ('k') | content/browser/appcache/appcache_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698