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

Side by Side Diff: components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc

Issue 1477643002: Remove the TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03 macro. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@basepass
Patch Set: type-with-move: no-media Created 5 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/scheduler/test/lazy_scheduler_message_loop_delegate_for_tes ts.h" 5 #include "components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tes ts.h"
6 6
7 #include <utility>
8
7 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
8 10
9 namespace scheduler { 11 namespace scheduler {
10 12
11 // static 13 // static
12 scoped_refptr<LazySchedulerMessageLoopDelegateForTests> 14 scoped_refptr<LazySchedulerMessageLoopDelegateForTests>
13 LazySchedulerMessageLoopDelegateForTests::Create() { 15 LazySchedulerMessageLoopDelegateForTests::Create() {
14 return make_scoped_refptr(new LazySchedulerMessageLoopDelegateForTests()); 16 return make_scoped_refptr(new LazySchedulerMessageLoopDelegateForTests());
15 } 17 }
16 18
(...skipping 13 matching lines...) Expand all
30 32
31 base::MessageLoop* LazySchedulerMessageLoopDelegateForTests::EnsureMessageLoop() 33 base::MessageLoop* LazySchedulerMessageLoopDelegateForTests::EnsureMessageLoop()
32 const { 34 const {
33 if (message_loop_) 35 if (message_loop_)
34 return message_loop_; 36 return message_loop_;
35 DCHECK(RunsTasksOnCurrentThread()); 37 DCHECK(RunsTasksOnCurrentThread());
36 message_loop_ = base::MessageLoop::current(); 38 message_loop_ = base::MessageLoop::current();
37 DCHECK(message_loop_); 39 DCHECK(message_loop_);
38 original_task_runner_ = message_loop_->task_runner(); 40 original_task_runner_ = message_loop_->task_runner();
39 if (pending_task_runner_) 41 if (pending_task_runner_)
40 message_loop_->SetTaskRunner(pending_task_runner_.Pass()); 42 message_loop_->SetTaskRunner(std::move(pending_task_runner_));
41 return message_loop_; 43 return message_loop_;
42 } 44 }
43 45
44 void LazySchedulerMessageLoopDelegateForTests::SetDefaultTaskRunner( 46 void LazySchedulerMessageLoopDelegateForTests::SetDefaultTaskRunner(
45 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 47 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
46 if (!HasMessageLoop()) { 48 if (!HasMessageLoop()) {
47 pending_task_runner_ = task_runner.Pass(); 49 pending_task_runner_ = std::move(task_runner);
48 return; 50 return;
49 } 51 }
50 message_loop_->SetTaskRunner(task_runner.Pass()); 52 message_loop_->SetTaskRunner(std::move(task_runner));
51 } 53 }
52 54
53 void LazySchedulerMessageLoopDelegateForTests::RestoreDefaultTaskRunner() { 55 void LazySchedulerMessageLoopDelegateForTests::RestoreDefaultTaskRunner() {
54 if (HasMessageLoop() && base::MessageLoop::current() == message_loop_) 56 if (HasMessageLoop() && base::MessageLoop::current() == message_loop_)
55 message_loop_->SetTaskRunner(original_task_runner_); 57 message_loop_->SetTaskRunner(original_task_runner_);
56 } 58 }
57 59
58 bool LazySchedulerMessageLoopDelegateForTests::HasMessageLoop() const { 60 bool LazySchedulerMessageLoopDelegateForTests::HasMessageLoop() const {
59 return message_loop_ != nullptr; 61 return message_loop_ != nullptr;
60 } 62 }
(...skipping 28 matching lines...) Expand all
89 return time_source_->NowTicks(); 91 return time_source_->NowTicks();
90 } 92 }
91 93
92 double LazySchedulerMessageLoopDelegateForTests::CurrentTimeSeconds() const { 94 double LazySchedulerMessageLoopDelegateForTests::CurrentTimeSeconds() const {
93 return base::Time::Now().ToDoubleT(); 95 return base::Time::Now().ToDoubleT();
94 } 96 }
95 97
96 void LazySchedulerMessageLoopDelegateForTests::OnNoMoreImmediateWork() {} 98 void LazySchedulerMessageLoopDelegateForTests::OnNoMoreImmediateWork() {}
97 99
98 } // namespace scheduler 100 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/worker_scheduler.cc ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698