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

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

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove some unneeded changes Created 4 years, 10 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 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 web_location.fileName(), -1, nullptr); 95 web_location.fileName(), -1, nullptr);
96 IdleTaskRunner()->PostIdleTaskAfterWakeup( 96 IdleTaskRunner()->PostIdleTaskAfterWakeup(
97 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, 97 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask,
98 base::Passed(make_scoped_ptr(idle_task)))); 98 base::Passed(make_scoped_ptr(idle_task))));
99 } 99 }
100 100
101 bool WebThreadBase::isCurrentThread() const { 101 bool WebThreadBase::isCurrentThread() const {
102 return TaskRunner()->BelongsToCurrentThread(); 102 return TaskRunner()->BelongsToCurrentThread();
103 } 103 }
104 104
105 double WebThreadBase::virtualTimeSeconds() {
106 return base::Time::Now().ToDoubleT();
107 }
108
109 double WebThreadBase::monotonicallyIncreasingVirtualTimeSeconds() {
110 return base::TimeTicks::Now().ToInternalValue() /
111 static_cast<double>(base::Time::kMicrosecondsPerSecond);
112 }
113
105 } // namespace scheduler 114 } // namespace scheduler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698