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

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

Issue 2123783002: Expose RunsTasksOnCurrentThread through WebTaskRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@00_fix_thread_affinity
Patch Set: rebase Created 4 years, 5 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 <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 10 matching lines...) Expand all
21 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); 21 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue);
22 22
23 ~WebTaskRunnerImpl() override; 23 ~WebTaskRunnerImpl() override;
24 24
25 // blink::WebTaskRunner implementation: 25 // blink::WebTaskRunner implementation:
26 void postTask(const blink::WebTraceLocation& web_location, 26 void postTask(const blink::WebTraceLocation& web_location,
27 blink::WebTaskRunner::Task* task) override; 27 blink::WebTaskRunner::Task* task) override;
28 void postDelayedTask(const blink::WebTraceLocation& web_location, 28 void postDelayedTask(const blink::WebTraceLocation& web_location,
29 blink::WebTaskRunner::Task* task, 29 blink::WebTaskRunner::Task* task,
30 double delayMs) override; 30 double delayMs) override;
31 bool runsTasksOnCurrentThread() override;
31 double virtualTimeSeconds() const override; 32 double virtualTimeSeconds() const override;
32 double monotonicallyIncreasingVirtualTimeSeconds() const override; 33 double monotonicallyIncreasingVirtualTimeSeconds() const override;
33 blink::WebTaskRunner* clone() override; 34 blink::WebTaskRunner* clone() override;
34 35
35 // blink::WebTaskRunner::Task should be wrapped by base::Passed() when 36 // blink::WebTaskRunner::Task should be wrapped by base::Passed() when
36 // used with base::Bind(). See https://crbug.com/551356. 37 // used with base::Bind(). See https://crbug.com/551356.
37 // runTask() is a helper to call blink::WebTaskRunner::Task::run from 38 // runTask() is a helper to call blink::WebTaskRunner::Task::run from
38 // std::unique_ptr<blink::WebTaskRunner::Task>. 39 // std::unique_ptr<blink::WebTaskRunner::Task>.
39 // runTask() is placed here because std::unique_ptr<> cannot be used from 40 // runTask() is placed here because std::unique_ptr<> cannot be used from
40 // Blink. 41 // Blink.
41 static void runTask(std::unique_ptr<blink::WebTaskRunner::Task>); 42 static void runTask(std::unique_ptr<blink::WebTaskRunner::Task>);
42 43
43 private: 44 private:
44 base::TimeTicks Now() const; 45 base::TimeTicks Now() const;
45 46
46 scoped_refptr<TaskQueue> task_queue_; 47 scoped_refptr<TaskQueue> task_queue_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); 49 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
49 }; 50 };
50 51
51 } // namespace scheduler 52 } // namespace scheduler
52 53
53 #endif // COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_ 54 #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