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

Side by Side Diff: components/scheduler/child/web_task_runner_impl.h

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 4 years, 9 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 #ifndef COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_ 5 #ifndef COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_
6 #define COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_ 6 #define COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/time.h"
11 #include "components/scheduler/scheduler_export.h" 12 #include "components/scheduler/scheduler_export.h"
12 #include "third_party/WebKit/public/platform/WebTaskRunner.h" 13 #include "third_party/WebKit/public/platform/WebTaskRunner.h"
13 14
14 namespace scheduler { 15 namespace scheduler {
15 class TaskQueue; 16 class TaskQueue;
16 17
17 class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner { 18 class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner {
18 public: 19 public:
19 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); 20 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue);
20 21
21 ~WebTaskRunnerImpl() override; 22 ~WebTaskRunnerImpl() override;
22 23
23 // blink::WebTaskRunner implementation: 24 // blink::WebTaskRunner implementation:
24 void postTask(const blink::WebTraceLocation& web_location, 25 void postTask(const blink::WebTraceLocation& web_location,
25 blink::WebTaskRunner::Task* task) override; 26 blink::WebTaskRunner::Task* task) override;
26 void postDelayedTask(const blink::WebTraceLocation& web_location, 27 void postDelayedTask(const blink::WebTraceLocation& web_location,
27 blink::WebTaskRunner::Task* task, 28 blink::WebTaskRunner::Task* task,
28 double delayMs) override; 29 double delayMs) override;
30 double virtualTimeSeconds() const override;
31 double monotonicallyIncreasingVirtualTimeSeconds() const override;
29 blink::WebTaskRunner* clone() override; 32 blink::WebTaskRunner* clone() override;
30 33
31 // blink::WebTaskRunner::Task should be wrapped by base::Passed() when 34 // blink::WebTaskRunner::Task should be wrapped by base::Passed() when
32 // used with base::Bind(). See https://crbug.com/551356. 35 // used with base::Bind(). See https://crbug.com/551356.
33 // runTask() is a helper to call blink::WebTaskRunner::Task::run from 36 // runTask() is a helper to call blink::WebTaskRunner::Task::run from
34 // scoped_ptr<blink::WebTaskRunner::Task>. 37 // scoped_ptr<blink::WebTaskRunner::Task>.
35 // runTask() is placed here because scoped_ptr<> cannot be used from Blink. 38 // runTask() is placed here because scoped_ptr<> cannot be used from Blink.
36 static void runTask(scoped_ptr<blink::WebTaskRunner::Task>); 39 static void runTask(scoped_ptr<blink::WebTaskRunner::Task>);
37 40
38 private: 41 private:
42 base::TimeTicks Now() const;
43
39 scoped_refptr<TaskQueue> task_queue_; 44 scoped_refptr<TaskQueue> task_queue_;
40 45
41 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); 46 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
42 }; 47 };
43 48
44 } // namespace scheduler 49 } // namespace scheduler
45 50
46 #endif // COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_ 51 #endif // COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_
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