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

Side by Side Diff: components/component_updater/component_updater_service.cc

Issue 2336913003: Mechanical change of base::Time to base::TimeTicks in the component updater. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | components/update_client/action_update_check.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/component_updater/component_updater_service.h" 5 #include "components/component_updater/component_updater_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 260 }
261 261
262 bool CrxUpdateService::OnDemandUpdateWithCooldown(const std::string& id) { 262 bool CrxUpdateService::OnDemandUpdateWithCooldown(const std::string& id) {
263 DCHECK(thread_checker_.CalledOnValidThread()); 263 DCHECK(thread_checker_.CalledOnValidThread());
264 264
265 DCHECK(GetComponent(id)); 265 DCHECK(GetComponent(id));
266 266
267 // Check if the request is too soon. 267 // Check if the request is too soon.
268 const auto* component_state(GetComponentState(id)); 268 const auto* component_state(GetComponentState(id));
269 if (component_state) { 269 if (component_state) {
270 base::TimeDelta delta = base::Time::Now() - component_state->last_check; 270 base::TimeDelta delta =
271 base::TimeTicks::Now() - component_state->last_check;
271 if (delta < base::TimeDelta::FromSeconds(config_->OnDemandDelay())) 272 if (delta < base::TimeDelta::FromSeconds(config_->OnDemandDelay()))
272 return false; 273 return false;
273 } 274 }
274 275
275 OnDemandUpdateInternal(id, CompletionCallback()); 276 OnDemandUpdateInternal(id, CompletionCallback());
276 return true; 277 return true;
277 } 278 }
278 279
279 void CrxUpdateService::OnDemandUpdateInternal(const std::string& id, 280 void CrxUpdateService::OnDemandUpdateInternal(const std::string& id,
280 CompletionCallback callback) { 281 CompletionCallback callback) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 // is the job of the browser process. 454 // is the job of the browser process.
454 // TODO(sorin): consider making this a singleton. 455 // TODO(sorin): consider making this a singleton.
455 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( 456 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory(
456 const scoped_refptr<Configurator>& config) { 457 const scoped_refptr<Configurator>& config) {
457 DCHECK(config); 458 DCHECK(config);
458 auto update_client = update_client::UpdateClientFactory(config); 459 auto update_client = update_client::UpdateClientFactory(config);
459 return base::MakeUnique<CrxUpdateService>(config, std::move(update_client)); 460 return base::MakeUnique<CrxUpdateService>(config, std::move(update_client));
460 } 461 }
461 462
462 } // namespace component_updater 463 } // namespace component_updater
OLDNEW
« no previous file with comments | « no previous file | components/update_client/action_update_check.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698