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

Side by Side Diff: services/ui/ws/user_activity_monitor.cc

Issue 2598963005: Include-what-you-use for WrapUnique/MakeUnique. (Closed)
Patch Set: manual change Created 3 years, 12 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/ws/user_activity_monitor.h" 5 #include "services/ui/ws/user_activity_monitor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h"
8 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
9 10
10 namespace ui { 11 namespace ui {
11 namespace ws { 12 namespace ws {
12 13
13 UserActivityMonitor::UserActivityMonitor(std::unique_ptr<base::TickClock> clock) 14 UserActivityMonitor::UserActivityMonitor(std::unique_ptr<base::TickClock> clock)
14 : now_clock_(std::move(clock)) { 15 : now_clock_(std::move(clock)) {
15 if (!now_clock_) 16 if (!now_clock_)
16 now_clock_ = base::WrapUnique(new base::DefaultTickClock); 17 now_clock_ = base::WrapUnique(new base::DefaultTickClock);
17 last_activity_ = now_clock_->NowTicks(); 18 last_activity_ = now_clock_->NowTicks();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 idle_observers_.erase(std::remove_if( 126 idle_observers_.erase(std::remove_if(
126 idle_observers_.begin(), idle_observers_.end(), 127 idle_observers_.begin(), idle_observers_.end(),
127 [observer]( 128 [observer](
128 const std::pair<IdleObserverInfo, mojom::UserIdleObserverPtr>& pair) { 129 const std::pair<IdleObserverInfo, mojom::UserIdleObserverPtr>& pair) {
129 return pair.second.get() == observer; 130 return pair.second.get() == observer;
130 })); 131 }));
131 } 132 }
132 133
133 } // namespace ws 134 } // namespace ws
134 } // namespace ui 135 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698