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

Side by Side Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 2825963003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/extensions (Closed)
Patch Set: Created 3 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/updater/extension_updater.h" 5 #include "chrome/browser/extensions/updater/extension_updater.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // Save the last check time, and schedule the next check. 268 // Save the last check time, and schedule the next check.
269 int64_t now = Time::Now().ToInternalValue(); 269 int64_t now = Time::Now().ToInternalValue();
270 prefs_->SetInt64(pref_names::kLastUpdateCheck, now); 270 prefs_->SetInt64(pref_names::kLastUpdateCheck, now);
271 ScheduleNextCheck(TimeDelta::FromSeconds(frequency_seconds_)); 271 ScheduleNextCheck(TimeDelta::FromSeconds(frequency_seconds_));
272 } 272 }
273 273
274 void ExtensionUpdater::CheckSoon() { 274 void ExtensionUpdater::CheckSoon() {
275 DCHECK(alive_); 275 DCHECK(alive_);
276 if (will_check_soon_) 276 if (will_check_soon_)
277 return; 277 return;
278 if (BrowserThread::PostTask( 278 if (BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
279 BrowserThread::UI, FROM_HERE, 279 base::BindOnce(&ExtensionUpdater::DoCheckSoon,
280 base::Bind(&ExtensionUpdater::DoCheckSoon, 280 weak_ptr_factory_.GetWeakPtr()))) {
281 weak_ptr_factory_.GetWeakPtr()))) {
282 will_check_soon_ = true; 281 will_check_soon_ = true;
283 } else { 282 } else {
284 NOTREACHED(); 283 NOTREACHED();
285 } 284 }
286 } 285 }
287 286
288 bool ExtensionUpdater::WillCheckSoon() const { 287 bool ExtensionUpdater::WillCheckSoon() const {
289 return will_check_soon_; 288 return will_check_soon_;
290 } 289 }
291 290
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 const InProgressCheck& request = requests_in_progress_[request_id]; 606 const InProgressCheck& request = requests_in_progress_[request_id];
608 if (request.in_progress_ids_.empty()) { 607 if (request.in_progress_ids_.empty()) {
609 VLOG(2) << "Finished update check " << request_id; 608 VLOG(2) << "Finished update check " << request_id;
610 if (!request.callback.is_null()) 609 if (!request.callback.is_null())
611 request.callback.Run(); 610 request.callback.Run();
612 requests_in_progress_.erase(request_id); 611 requests_in_progress_.erase(request_id);
613 } 612 }
614 } 613 }
615 614
616 } // namespace extensions 615 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/updater/extension_cache_fake.cc ('k') | chrome/browser/extensions/user_script_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698