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

Side by Side Diff: components/scheduler/child/web_task_runner_impl.cc

Issue 2148363004: Use std::unique_ptr<> for WebTaskRunner::clone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « components/scheduler/child/web_task_runner_impl.h ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/child/web_task_runner_impl.h" 5 #include "components/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 "components/scheduler/base/task_queue.h" 10 #include "components/scheduler/base/task_queue.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 base::TimeTicks WebTaskRunnerImpl::Now() const { 54 base::TimeTicks WebTaskRunnerImpl::Now() const {
55 TimeDomain* time_domain = task_queue_->GetTimeDomain(); 55 TimeDomain* time_domain = task_queue_->GetTimeDomain();
56 // It's possible task_queue_ has been Unregistered which can lead to a null 56 // It's possible task_queue_ has been Unregistered which can lead to a null
57 // TimeDomain. If that happens just return the current real time. 57 // TimeDomain. If that happens just return the current real time.
58 if (!time_domain) 58 if (!time_domain)
59 return base::TimeTicks::Now(); 59 return base::TimeTicks::Now();
60 return time_domain->Now(); 60 return time_domain->Now();
61 } 61 }
62 62
63 blink::WebTaskRunner* WebTaskRunnerImpl::clone() { 63 std::unique_ptr<blink::WebTaskRunner> WebTaskRunnerImpl::clone() {
64 return new WebTaskRunnerImpl(task_queue_); 64 return base::WrapUnique(new WebTaskRunnerImpl(task_queue_));
65 } 65 }
66 66
67 void WebTaskRunnerImpl::runTask( 67 void WebTaskRunnerImpl::runTask(
68 std::unique_ptr<blink::WebTaskRunner::Task> task) { 68 std::unique_ptr<blink::WebTaskRunner::Task> task) {
69 task->run(); 69 task->run();
70 } 70 }
71 71
72 } // namespace scheduler 72 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/web_task_runner_impl.h ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698