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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase Created 3 years, 8 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 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 "platform/scheduler/child/web_task_runner_impl.h" 5 #include "platform/scheduler/child/web_task_runner_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 12 matching lines...) Expand all
23 23
24 void WebTaskRunnerImpl::PostDelayedTask(const WebTraceLocation& location, 24 void WebTaskRunnerImpl::PostDelayedTask(const WebTraceLocation& location,
25 base::OnceClosure task, 25 base::OnceClosure task,
26 double delay_ms) { 26 double delay_ms) {
27 DCHECK_GE(delay_ms, 0.0) << location.function_name() << " " 27 DCHECK_GE(delay_ms, 0.0) << location.function_name() << " "
28 << location.file_name(); 28 << location.file_name();
29 task_queue_->PostDelayedTask(location, std::move(task), 29 task_queue_->PostDelayedTask(location, std::move(task),
30 base::TimeDelta::FromMillisecondsD(delay_ms)); 30 base::TimeDelta::FromMillisecondsD(delay_ms));
31 } 31 }
32 32
33 bool WebTaskRunnerImpl::RunsTasksOnCurrentThread() { 33 bool WebTaskRunnerImpl::RunsTasksInCurrentSequence() {
34 return task_queue_->RunsTasksOnCurrentThread(); 34 return task_queue_->RunsTasksInCurrentSequence();
35 } 35 }
36 36
37 double WebTaskRunnerImpl::VirtualTimeSeconds() const { 37 double WebTaskRunnerImpl::VirtualTimeSeconds() const {
38 return (Now() - base::TimeTicks::UnixEpoch()).InSecondsF(); 38 return (Now() - base::TimeTicks::UnixEpoch()).InSecondsF();
39 } 39 }
40 40
41 double WebTaskRunnerImpl::MonotonicallyIncreasingVirtualTimeSeconds() const { 41 double WebTaskRunnerImpl::MonotonicallyIncreasingVirtualTimeSeconds() const {
42 return Now().ToInternalValue() / 42 return Now().ToInternalValue() /
43 static_cast<double>(base::Time::kMicrosecondsPerSecond); 43 static_cast<double>(base::Time::kMicrosecondsPerSecond);
44 } 44 }
(...skipping 11 matching lines...) Expand all
56 return base::TimeTicks::Now(); 56 return base::TimeTicks::Now();
57 return time_domain->Now(); 57 return time_domain->Now();
58 } 58 }
59 59
60 base::SingleThreadTaskRunner* WebTaskRunnerImpl::ToSingleThreadTaskRunner() { 60 base::SingleThreadTaskRunner* WebTaskRunnerImpl::ToSingleThreadTaskRunner() {
61 return task_queue_.get(); 61 return task_queue_.get();
62 } 62 }
63 63
64 } // namespace scheduler 64 } // namespace scheduler
65 } // namespace blink 65 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698