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

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

Issue 1630903003: Remove not needed ExtensionUpdater::default_params_ and its setter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed ExtensionUpdater::default_params_ Created 4 years, 11 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
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 // Save the time of next check. 263 // Save the time of next check.
264 Time next = Time::Now() + actual_delay; 264 Time next = Time::Now() + actual_delay;
265 prefs_->SetInt64(pref_names::kNextUpdateCheck, next.ToInternalValue()); 265 prefs_->SetInt64(pref_names::kNextUpdateCheck, next.ToInternalValue());
266 266
267 timer_.Start(FROM_HERE, actual_delay, this, &ExtensionUpdater::TimerFired); 267 timer_.Start(FROM_HERE, actual_delay, this, &ExtensionUpdater::TimerFired);
268 } 268 }
269 269
270 void ExtensionUpdater::TimerFired() { 270 void ExtensionUpdater::TimerFired() {
271 DCHECK(alive_); 271 DCHECK(alive_);
272 CheckNow(default_params_); 272 CheckNow(CheckParams());
273 273
274 // If the user has overridden the update frequency, don't bother reporting 274 // If the user has overridden the update frequency, don't bother reporting
275 // this. 275 // this.
276 if (frequency_seconds_ == extensions::kDefaultUpdateFrequencySeconds) { 276 if (frequency_seconds_ == extensions::kDefaultUpdateFrequencySeconds) {
277 Time last = Time::FromInternalValue(prefs_->GetInt64( 277 Time last = Time::FromInternalValue(prefs_->GetInt64(
278 pref_names::kLastUpdateCheck)); 278 pref_names::kLastUpdateCheck));
279 if (last.ToInternalValue() != 0) { 279 if (last.ToInternalValue() != 0) {
280 // Use counts rather than time so we can use minutes rather than millis. 280 // Use counts rather than time so we can use minutes rather than millis.
281 UMA_HISTOGRAM_CUSTOM_COUNTS("Extensions.UpdateCheckGap", 281 UMA_HISTOGRAM_CUSTOM_COUNTS("Extensions.UpdateCheckGap",
282 (Time::Now() - last).InMinutes(), 282 (Time::Now() - last).InMinutes(),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 ExtensionCache* extension_cache) { 314 ExtensionCache* extension_cache) {
315 extension_cache_ = extension_cache; 315 extension_cache_ = extension_cache;
316 } 316 }
317 317
318 void ExtensionUpdater::StopTimerForTesting() { 318 void ExtensionUpdater::StopTimerForTesting() {
319 timer_.Stop(); 319 timer_.Stop();
320 } 320 }
321 321
322 void ExtensionUpdater::DoCheckSoon() { 322 void ExtensionUpdater::DoCheckSoon() {
323 DCHECK(will_check_soon_); 323 DCHECK(will_check_soon_);
324 CheckNow(default_params_); 324 CheckNow(CheckParams());
325 will_check_soon_ = false; 325 will_check_soon_ = false;
326 } 326 }
327 327
328 void ExtensionUpdater::AddToDownloader( 328 void ExtensionUpdater::AddToDownloader(
329 const ExtensionSet* extensions, 329 const ExtensionSet* extensions,
330 const std::list<std::string>& pending_ids, 330 const std::list<std::string>& pending_ids,
331 int request_id) { 331 int request_id) {
332 InProgressCheck& request = requests_in_progress_[request_id]; 332 InProgressCheck& request = requests_in_progress_[request_id];
333 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); 333 for (ExtensionSet::const_iterator extension_iter = extensions->begin();
334 extension_iter != extensions->end(); ++extension_iter) { 334 extension_iter != extensions->end(); ++extension_iter) {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 const InProgressCheck& request = requests_in_progress_[request_id]; 673 const InProgressCheck& request = requests_in_progress_[request_id];
674 if (request.in_progress_ids_.empty()) { 674 if (request.in_progress_ids_.empty()) {
675 VLOG(2) << "Finished update check " << request_id; 675 VLOG(2) << "Finished update check " << request_id;
676 if (!request.callback.is_null()) 676 if (!request.callback.is_null())
677 request.callback.Run(); 677 request.callback.Run();
678 requests_in_progress_.erase(request_id); 678 requests_in_progress_.erase(request_id);
679 } 679 }
680 } 680 }
681 681
682 } // namespace extensions 682 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698