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

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

Issue 2137013002: Make WebTraceLocation be an alias of tracked_objects::Location (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 | « no previous file | components/scheduler/child/web_task_runner_impl.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_scheduler_impl.h" 5 #include "components/scheduler/child/web_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h"
8 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
9 #include "components/scheduler/child/web_task_runner_impl.h" 10 #include "components/scheduler/child/web_task_runner_impl.h"
10 #include "components/scheduler/child/worker_scheduler.h" 11 #include "components/scheduler/child/worker_scheduler.h"
11 #include "third_party/WebKit/public/platform/WebTraceLocation.h" 12 #include "third_party/WebKit/public/platform/WebTraceLocation.h"
12 #include "third_party/WebKit/public/platform/WebViewScheduler.h" 13 #include "third_party/WebKit/public/platform/WebViewScheduler.h"
13 14
14 namespace scheduler { 15 namespace scheduler {
15 16
16 WebSchedulerImpl::WebSchedulerImpl( 17 WebSchedulerImpl::WebSchedulerImpl(
17 ChildScheduler* child_scheduler, 18 ChildScheduler* child_scheduler,
(...skipping 20 matching lines...) Expand all
38 bool WebSchedulerImpl::canExceedIdleDeadlineIfRequired() { 39 bool WebSchedulerImpl::canExceedIdleDeadlineIfRequired() {
39 return child_scheduler_->CanExceedIdleDeadlineIfRequired(); 40 return child_scheduler_->CanExceedIdleDeadlineIfRequired();
40 } 41 }
41 42
42 void WebSchedulerImpl::runIdleTask( 43 void WebSchedulerImpl::runIdleTask(
43 std::unique_ptr<blink::WebThread::IdleTask> task, 44 std::unique_ptr<blink::WebThread::IdleTask> task,
44 base::TimeTicks deadline) { 45 base::TimeTicks deadline) {
45 task->run((deadline - base::TimeTicks()).InSecondsF()); 46 task->run((deadline - base::TimeTicks()).InSecondsF());
46 } 47 }
47 48
48 void WebSchedulerImpl::postIdleTask(const blink::WebTraceLocation& web_location, 49 void WebSchedulerImpl::postIdleTask(const blink::WebTraceLocation& location,
49 blink::WebThread::IdleTask* task) { 50 blink::WebThread::IdleTask* task) {
50 DCHECK(idle_task_runner_); 51 DCHECK(idle_task_runner_);
51 std::unique_ptr<blink::WebThread::IdleTask> scoped_task(task);
52 tracked_objects::Location location(web_location.functionName(),
53 web_location.fileName(), -1, nullptr);
54 idle_task_runner_->PostIdleTask( 52 idle_task_runner_->PostIdleTask(
55 location, 53 location,
56 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); 54 base::Bind(&WebSchedulerImpl::runIdleTask,
55 base::Passed(base::WrapUnique(task))));
57 } 56 }
58 57
59 void WebSchedulerImpl::postNonNestableIdleTask( 58 void WebSchedulerImpl::postNonNestableIdleTask(
60 const blink::WebTraceLocation& web_location, 59 const blink::WebTraceLocation& location,
61 blink::WebThread::IdleTask* task) { 60 blink::WebThread::IdleTask* task) {
62 DCHECK(idle_task_runner_); 61 DCHECK(idle_task_runner_);
63 std::unique_ptr<blink::WebThread::IdleTask> scoped_task(task);
64 tracked_objects::Location location(web_location.functionName(),
65 web_location.fileName(), -1, nullptr);
66 idle_task_runner_->PostNonNestableIdleTask( 62 idle_task_runner_->PostNonNestableIdleTask(
67 location, 63 location,
68 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); 64 base::Bind(&WebSchedulerImpl::runIdleTask,
65 base::Passed(base::WrapUnique(task))));
69 } 66 }
70 67
71 void WebSchedulerImpl::postIdleTaskAfterWakeup( 68 void WebSchedulerImpl::postIdleTaskAfterWakeup(
72 const blink::WebTraceLocation& web_location, 69 const blink::WebTraceLocation& location,
73 blink::WebThread::IdleTask* task) { 70 blink::WebThread::IdleTask* task) {
74 DCHECK(idle_task_runner_); 71 DCHECK(idle_task_runner_);
75 std::unique_ptr<blink::WebThread::IdleTask> scoped_task(task);
76 tracked_objects::Location location(web_location.functionName(),
77 web_location.fileName(), -1, nullptr);
78 idle_task_runner_->PostIdleTaskAfterWakeup( 72 idle_task_runner_->PostIdleTaskAfterWakeup(
79 location, 73 location,
80 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); 74 base::Bind(&WebSchedulerImpl::runIdleTask,
75 base::Passed(base::WrapUnique(task))));
81 } 76 }
82 77
83 blink::WebTaskRunner* WebSchedulerImpl::loadingTaskRunner() { 78 blink::WebTaskRunner* WebSchedulerImpl::loadingTaskRunner() {
84 return loading_web_task_runner_.get(); 79 return loading_web_task_runner_.get();
85 } 80 }
86 81
87 blink::WebTaskRunner* WebSchedulerImpl::timerTaskRunner() { 82 blink::WebTaskRunner* WebSchedulerImpl::timerTaskRunner() {
88 return timer_web_task_runner_.get(); 83 return timer_web_task_runner_.get();
89 } 84 }
90 85
91 std::unique_ptr<blink::WebViewScheduler> 86 std::unique_ptr<blink::WebViewScheduler>
92 WebSchedulerImpl::createWebViewScheduler(blink::WebView*) { 87 WebSchedulerImpl::createWebViewScheduler(blink::WebView*) {
93 NOTREACHED(); 88 NOTREACHED();
94 return nullptr; 89 return nullptr;
95 } 90 }
96 91
97 } // namespace scheduler 92 } // namespace scheduler
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/child/web_task_runner_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698