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

Side by Side Diff: components/scheduler/child/webthread_base.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 | « components/scheduler/child/webthread_base.h ('k') | components/test_runner/test_plugin.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // An implementation of WebThread in terms of base::MessageLoop and 5 // An implementation of WebThread in terms of base::MessageLoop and
6 // base::Thread 6 // base::Thread
7 7
8 #include "components/scheduler/child/webthread_base.h" 8 #include "components/scheduler/child/webthread_base.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 base::MessageLoop::current()->RemoveTaskObserver(observer); 73 base::MessageLoop::current()->RemoveTaskObserver(observer);
74 } 74 }
75 75
76 // static 76 // static
77 void WebThreadBase::RunWebThreadIdleTask( 77 void WebThreadBase::RunWebThreadIdleTask(
78 std::unique_ptr<blink::WebThread::IdleTask> idle_task, 78 std::unique_ptr<blink::WebThread::IdleTask> idle_task,
79 base::TimeTicks deadline) { 79 base::TimeTicks deadline) {
80 idle_task->run((deadline - base::TimeTicks()).InSecondsF()); 80 idle_task->run((deadline - base::TimeTicks()).InSecondsF());
81 } 81 }
82 82
83 void WebThreadBase::postIdleTask(const blink::WebTraceLocation& location, 83 void WebThreadBase::postIdleTask(const blink::WebTraceLocation& web_location,
84 IdleTask* idle_task) { 84 IdleTask* idle_task) {
85 tracked_objects::Location location(web_location.functionName(),
86 web_location.fileName(), -1, nullptr);
85 GetIdleTaskRunner()->PostIdleTask( 87 GetIdleTaskRunner()->PostIdleTask(
86 location, 88 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask,
87 base::Bind(&WebThreadBase::RunWebThreadIdleTask, 89 base::Passed(base::WrapUnique(idle_task))));
88 base::Passed(base::WrapUnique(idle_task))));
89 } 90 }
90 91
91 void WebThreadBase::postIdleTaskAfterWakeup( 92 void WebThreadBase::postIdleTaskAfterWakeup(
92 const blink::WebTraceLocation& location, 93 const blink::WebTraceLocation& web_location,
93 IdleTask* idle_task) { 94 IdleTask* idle_task) {
95 tracked_objects::Location location(web_location.functionName(),
96 web_location.fileName(), -1, nullptr);
94 GetIdleTaskRunner()->PostIdleTaskAfterWakeup( 97 GetIdleTaskRunner()->PostIdleTaskAfterWakeup(
95 location, 98 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask,
96 base::Bind(&WebThreadBase::RunWebThreadIdleTask, 99 base::Passed(base::WrapUnique(idle_task))));
97 base::Passed(base::WrapUnique(idle_task))));
98 } 100 }
99 101
100 bool WebThreadBase::isCurrentThread() const { 102 bool WebThreadBase::isCurrentThread() const {
101 return GetTaskRunner()->BelongsToCurrentThread(); 103 return GetTaskRunner()->BelongsToCurrentThread();
102 } 104 }
103 105
104 } // namespace scheduler 106 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/webthread_base.h ('k') | components/test_runner/test_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698