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

Side by Side Diff: components/domain_reliability/dispatcher.cc

Issue 2231753002: components: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more call site Created 4 years, 4 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 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/domain_reliability/dispatcher.h" 5 #include "components/domain_reliability/dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 29 matching lines...) Expand all
40 max_delay(max_delay), 40 max_delay(max_delay),
41 eligible(false) {} 41 eligible(false) {}
42 42
43 DomainReliabilityDispatcher::Task::~Task() {} 43 DomainReliabilityDispatcher::Task::~Task() {}
44 44
45 DomainReliabilityDispatcher::DomainReliabilityDispatcher(MockableTime* time) 45 DomainReliabilityDispatcher::DomainReliabilityDispatcher(MockableTime* time)
46 : time_(time) {} 46 : time_(time) {}
47 47
48 DomainReliabilityDispatcher::~DomainReliabilityDispatcher() { 48 DomainReliabilityDispatcher::~DomainReliabilityDispatcher() {
49 // TODO(juliatuttle): STLElementDeleter? 49 // TODO(juliatuttle): STLElementDeleter?
50 STLDeleteElements(&tasks_); 50 base::STLDeleteElements(&tasks_);
51 } 51 }
52 52
53 void DomainReliabilityDispatcher::ScheduleTask( 53 void DomainReliabilityDispatcher::ScheduleTask(
54 const base::Closure& closure, 54 const base::Closure& closure,
55 base::TimeDelta min_delay, 55 base::TimeDelta min_delay,
56 base::TimeDelta max_delay) { 56 base::TimeDelta max_delay) {
57 DCHECK(!closure.is_null()); 57 DCHECK(!closure.is_null());
58 // Would be DCHECK_LE, but you can't << a TimeDelta. 58 // Would be DCHECK_LE, but you can't << a TimeDelta.
59 DCHECK(min_delay <= max_delay); 59 DCHECK(min_delay <= max_delay);
60 60
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 DCHECK(task); 111 DCHECK(task);
112 DCHECK(!task->closure.is_null()); 112 DCHECK(!task->closure.is_null());
113 task->closure.Run(); 113 task->closure.Run();
114 if (task->eligible) 114 if (task->eligible)
115 eligible_tasks_.erase(task); 115 eligible_tasks_.erase(task);
116 tasks_.erase(task); 116 tasks_.erase(task);
117 delete task; 117 delete task;
118 } 118 }
119 119
120 } // namespace domain_reliability 120 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/context.cc ('k') | components/domain_reliability/google_configs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698