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

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: Rebased 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 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 "components/scheduler/scheduler_export.h" 11 #include "components/scheduler/scheduler_export.h"
12 #include "third_party/WebKit/public/platform/WebTaskRunner.h" 12 #include "third_party/WebKit/public/platform/WebTaskRunner.h"
13 13
14 namespace scheduler { 14 namespace scheduler {
15 class TaskQueue; 15 class TaskQueue;
16 16
17 class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner { 17 class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner {
18 public: 18 public:
19 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); 19 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue);
20 20
21 ~WebTaskRunnerImpl() override; 21 ~WebTaskRunnerImpl() override;
22 22
23 // blink::WebTaskRunner implementation: 23 // blink::WebTaskRunner implementation:
24 void postTask(const blink::WebTraceLocation& web_location, 24 void postTask(const blink::WebTraceLocation& web_location,
25 blink::WebTaskRunner::Task* task) override; 25 blink::WebTaskRunner::Task* task) override;
26 void postDelayedTask(const blink::WebTraceLocation& web_location, 26 void postDelayedTask(const blink::WebTraceLocation& web_location,
27 blink::WebTaskRunner::Task* task, 27 blink::WebTaskRunner::Task* task,
28 double delayMs) override; 28 double delayMs) override;
29 double virtualTimeSeconds() const override;
30 double monotonicallyIncreasingVirtualTimeSeconds() const override;
29 blink::WebTaskRunner* clone() override; 31 blink::WebTaskRunner* clone() override;
30 32
31 // blink::WebTaskRunner::Task should be wrapped by base::Passed() when 33 // blink::WebTaskRunner::Task should be wrapped by base::Passed() when
32 // used with base::Bind(). See https://crbug.com/551356. 34 // used with base::Bind(). See https://crbug.com/551356.
33 // runTask() is a helper to call blink::WebTaskRunner::Task::run from 35 // runTask() is a helper to call blink::WebTaskRunner::Task::run from
34 // scoped_ptr<blink::WebTaskRunner::Task>. 36 // scoped_ptr<blink::WebTaskRunner::Task>.
35 // runTask() is placed here because scoped_ptr<> cannot be used from Blink. 37 // runTask() is placed here because scoped_ptr<> cannot be used from Blink.
36 static void runTask(scoped_ptr<blink::WebTaskRunner::Task>); 38 static void runTask(scoped_ptr<blink::WebTaskRunner::Task>);
37 39
38 private: 40 private:
39 scoped_refptr<TaskQueue> task_queue_; 41 scoped_refptr<TaskQueue> task_queue_;
40 42
41 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); 43 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
42 }; 44 };
43 45
44 } // namespace scheduler 46 } // namespace scheduler
45 47
46 #endif // COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_ 48 #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') | third_party/WebKit/Source/platform/Timer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698