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

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

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