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

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

Issue 7824041: Update base/timer.h code to pass through Location from call sites. (reland) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: touch Created 9 years, 3 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 | 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 "chrome/browser/extensions/extension_updater.h" 5 #include "chrome/browser/extensions/extension_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 double jitter_factor = (RandDouble() * .2) - 0.1; 934 double jitter_factor = (RandDouble() * .2) - 0.1;
935 delay_ms += delay_ms * jitter_factor; 935 delay_ms += delay_ms * jitter_factor;
936 TimeDelta actual_delay = TimeDelta::FromMilliseconds( 936 TimeDelta actual_delay = TimeDelta::FromMilliseconds(
937 static_cast<int64>(delay_ms)); 937 static_cast<int64>(delay_ms));
938 938
939 // Save the time of next check. 939 // Save the time of next check.
940 Time next = Time::Now() + actual_delay; 940 Time next = Time::Now() + actual_delay;
941 prefs_->SetInt64(kNextExtensionsUpdateCheck, next.ToInternalValue()); 941 prefs_->SetInt64(kNextExtensionsUpdateCheck, next.ToInternalValue());
942 prefs_->ScheduleSavePersistentPrefs(); 942 prefs_->ScheduleSavePersistentPrefs();
943 943
944 timer_.Start(actual_delay, this, &ExtensionUpdater::TimerFired); 944 timer_.Start(FROM_HERE, actual_delay, this, &ExtensionUpdater::TimerFired);
945 } 945 }
946 946
947 void ExtensionUpdater::TimerFired() { 947 void ExtensionUpdater::TimerFired() {
948 DCHECK(alive_); 948 DCHECK(alive_);
949 CheckNow(); 949 CheckNow();
950 950
951 // If the user has overridden the update frequency, don't bother reporting 951 // If the user has overridden the update frequency, don't bother reporting
952 // this. 952 // this.
953 if (frequency_seconds_ == ExtensionService::kDefaultUpdateFrequencySeconds) { 953 if (frequency_seconds_ == ExtensionService::kDefaultUpdateFrequencySeconds) {
954 Time last = Time::FromInternalValue(prefs_->GetInt64( 954 Time last = Time::FromInternalValue(prefs_->GetInt64(
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 std::set<std::string>::const_iterator i; 1241 std::set<std::string>::const_iterator i;
1242 for (i = ids.begin(); i != ids.end(); ++i) 1242 for (i = ids.begin(); i != ids.end(); ++i)
1243 in_progress_ids_.insert(*i); 1243 in_progress_ids_.insert(*i);
1244 } 1244 }
1245 1245
1246 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { 1246 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) {
1247 std::set<std::string>::const_iterator i; 1247 std::set<std::string>::const_iterator i;
1248 for (i = ids.begin(); i != ids.end(); ++i) 1248 for (i = ids.begin(); i != ids.end(); ++i)
1249 in_progress_ids_.erase(*i); 1249 in_progress_ids_.erase(*i);
1250 } 1250 }
OLDNEW
« no previous file with comments | « chrome/browser/enumerate_modules_model_win.cc ('k') | chrome/browser/extensions/extension_web_socket_proxy_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698