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

Side by Side Diff: webkit/appcache/appcache_group.cc

Issue 8515019: base::Bind: Convert most of webkit/appcache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
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 #include "webkit/appcache/appcache_group.h" 5 #include "webkit/appcache/appcache_group.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h"
csilv 2011/11/10 23:47:02 I don't see a need for this right now, unless you
James Hawkins 2011/11/11 19:30:39 Done.
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "base/message_loop.h" 11 #include "base/message_loop.h"
11 #include "webkit/appcache/appcache.h" 12 #include "webkit/appcache/appcache.h"
12 #include "webkit/appcache/appcache_host.h" 13 #include "webkit/appcache/appcache_host.h"
13 #include "webkit/appcache/appcache_service.h" 14 #include "webkit/appcache/appcache_service.h"
14 #include "webkit/appcache/appcache_storage.h" 15 #include "webkit/appcache/appcache_storage.h"
15 #include "webkit/appcache/appcache_update_job.h" 16 #include "webkit/appcache/appcache_update_job.h"
16 17
17 namespace appcache { 18 namespace appcache {
18 19
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 224 }
224 225
225 bool AppCacheGroup::FindObserver(UpdateObserver* find_me, 226 bool AppCacheGroup::FindObserver(UpdateObserver* find_me,
226 const ObserverList<UpdateObserver>& observer_list) { 227 const ObserverList<UpdateObserver>& observer_list) {
227 return observer_list.HasObserver(find_me); 228 return observer_list.HasObserver(find_me);
228 } 229 }
229 230
230 void AppCacheGroup::ScheduleUpdateRestart(int delay_ms) { 231 void AppCacheGroup::ScheduleUpdateRestart(int delay_ms) {
231 DCHECK(!restart_update_task_); 232 DCHECK(!restart_update_task_);
232 restart_update_task_ = 233 restart_update_task_ =
233 NewRunnableMethod(this, &AppCacheGroup::RunQueuedUpdates); 234 NewRunnableMethod(this, &AppCacheGroup::RunQueuedUpdates);
csilv 2011/11/10 23:47:02 Do you want to convert this one?
James Hawkins 2011/11/11 19:30:39 |restart_update_task_| is a CancelableTask, so we
234 MessageLoop::current()->PostDelayedTask(FROM_HERE, restart_update_task_, 235 MessageLoop::current()->PostDelayedTask(FROM_HERE, restart_update_task_,
235 delay_ms); 236 delay_ms);
236 } 237 }
237 238
238 void AppCacheGroup::HostDestructionImminent(AppCacheHost* host) { 239 void AppCacheGroup::HostDestructionImminent(AppCacheHost* host) {
239 queued_updates_.erase(host); 240 queued_updates_.erase(host);
240 if (queued_updates_.empty() && restart_update_task_) { 241 if (queued_updates_.empty() && restart_update_task_) {
241 restart_update_task_->Cancel(); 242 restart_update_task_->Cancel();
242 restart_update_task_ = NULL; 243 restart_update_task_ = NULL;
243 } 244 }
(...skipping 14 matching lines...) Expand all
258 // deletion by adding an extra ref in this scope (but only if we're not 259 // deletion by adding an extra ref in this scope (but only if we're not
259 // in our destructor). 260 // in our destructor).
260 scoped_refptr<AppCacheGroup> protect(is_in_dtor_ ? NULL : this); 261 scoped_refptr<AppCacheGroup> protect(is_in_dtor_ ? NULL : this);
261 FOR_EACH_OBSERVER(UpdateObserver, observers_, OnUpdateComplete(this)); 262 FOR_EACH_OBSERVER(UpdateObserver, observers_, OnUpdateComplete(this));
262 if (!queued_updates_.empty()) 263 if (!queued_updates_.empty())
263 ScheduleUpdateRestart(kUpdateRestartDelayMs); 264 ScheduleUpdateRestart(kUpdateRestartDelayMs);
264 } 265 }
265 } 266 }
266 267
267 } // namespace appcache 268 } // namespace appcache
OLDNEW
« no previous file with comments | « no previous file | webkit/appcache/appcache_request_handler_unittest.cc » ('j') | webkit/appcache/appcache_response_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698