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

Side by Side Diff: components/timers/alarm_timer_chromeos.cc

Issue 1552023002: Convert Pass()→std::move() in //components (CrOS edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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/timers/alarm_timer_chromeos.h" 5 #include "components/timers/alarm_timer_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <sys/timerfd.h> 8 #include <sys/timerfd.h>
9 #include <utility>
9 10
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
12 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
13 #include "base/lazy_instance.h" 14 #include "base/lazy_instance.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
17 #include "base/pending_task.h" 18 #include "base/pending_task.h"
18 #include "base/thread_task_runner_handle.h" 19 #include "base/thread_task_runner_handle.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 } 419 }
419 420
420 void AlarmTimer::OnTimerFired() { 421 void AlarmTimer::OnTimerFired() {
421 if (!base::Timer::IsRunning()) 422 if (!base::Timer::IsRunning())
422 return; 423 return;
423 424
424 DCHECK(pending_task_.get()); 425 DCHECK(pending_task_.get());
425 426
426 // Take ownership of the pending user task, which is going to be cleared by 427 // Take ownership of the pending user task, which is going to be cleared by
427 // the Stop() or Reset() functions below. 428 // the Stop() or Reset() functions below.
428 scoped_ptr<base::PendingTask> pending_user_task(pending_task_.Pass()); 429 scoped_ptr<base::PendingTask> pending_user_task(std::move(pending_task_));
429 430
430 // Re-schedule or stop the timer as requested. 431 // Re-schedule or stop the timer as requested.
431 if (base::Timer::is_repeating()) 432 if (base::Timer::is_repeating())
432 Reset(); 433 Reset();
433 else 434 else
434 Stop(); 435 Stop();
435 436
436 TRACE_TASK_EXECUTION("AlarmTimer::OnTimerFired", *pending_user_task); 437 TRACE_TASK_EXECUTION("AlarmTimer::OnTimerFired", *pending_user_task);
437 438
438 // Now run the user task. 439 // Now run the user task.
(...skipping 26 matching lines...) Expand all
465 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from, 466 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from,
466 base::TimeDelta delay, 467 base::TimeDelta delay,
467 const base::Closure& user_task) 468 const base::Closure& user_task)
468 : AlarmTimer(posted_from, delay, user_task, false) { 469 : AlarmTimer(posted_from, delay, user_task, false) {
469 } 470 }
470 471
471 SimpleAlarmTimer::~SimpleAlarmTimer() { 472 SimpleAlarmTimer::~SimpleAlarmTimer() {
472 } 473 }
473 474
474 } // namespace timers 475 } // namespace timers
OLDNEW
« no previous file with comments | « components/storage_monitor/storage_monitor_chromeos_unittest.cc ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698