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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc

Issue 2266443002: Optimize posting of WTF::Closure and improve scheduler test mocks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cut back to just the WTF::Closure fix plus the scheduler test mock refactor. 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
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 "platform/scheduler/child/web_task_runner_impl.h" 5 #include "platform/scheduler/child/web_task_runner_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "public/platform/scheduler/base/task_queue.h" 10 #include "public/platform/scheduler/base/task_queue.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // TimeDomain. If that happens just return the current real time. 55 // TimeDomain. If that happens just return the current real time.
56 if (!time_domain) 56 if (!time_domain)
57 return base::TimeTicks::Now(); 57 return base::TimeTicks::Now();
58 return time_domain->Now(); 58 return time_domain->Now();
59 } 59 }
60 60
61 std::unique_ptr<blink::WebTaskRunner> WebTaskRunnerImpl::clone() { 61 std::unique_ptr<blink::WebTaskRunner> WebTaskRunnerImpl::clone() {
62 return base::WrapUnique(new WebTaskRunnerImpl(task_queue_)); 62 return base::WrapUnique(new WebTaskRunnerImpl(task_queue_));
63 } 63 }
64 64
65 base::SingleThreadTaskRunner* WebTaskRunnerImpl::taskRunner() { 65 base::SingleThreadTaskRunner* WebTaskRunnerImpl::toSingleThreadTaskRunner() {
66 return task_queue_.get(); 66 return task_queue_.get();
67 } 67 }
68 68
69 void WebTaskRunnerImpl::runTask( 69 void WebTaskRunnerImpl::runTask(
70 std::unique_ptr<blink::WebTaskRunner::Task> task) { 70 std::unique_ptr<blink::WebTaskRunner::Task> task) {
71 task->run(); 71 task->run();
72 } 72 }
73 73
74 } // namespace scheduler 74 } // namespace scheduler
75 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698