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

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

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_ H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_ H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_ H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_ H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 12 matching lines...) Expand all
23 23
24 ~WebTaskRunnerImpl() override; 24 ~WebTaskRunnerImpl() override;
25 25
26 // WebTaskRunner implementation: 26 // WebTaskRunner implementation:
27 void postTask(const WebTraceLocation& web_location, 27 void postTask(const WebTraceLocation& web_location,
28 WebTaskRunner::Task* task) override; 28 WebTaskRunner::Task* task) override;
29 void postDelayedTask(const WebTraceLocation& web_location, 29 void postDelayedTask(const WebTraceLocation& web_location,
30 WebTaskRunner::Task* task, 30 WebTaskRunner::Task* task,
31 double delayMs) override; 31 double delayMs) override;
32 void postDelayedTask(const WebTraceLocation&, 32 void postDelayedTask(const WebTraceLocation&,
33 const base::Closure&, 33 base::OnceClosure,
34 double delayMs) override; 34 double delayMs) override;
35 bool runsTasksOnCurrentThread() override; 35 bool runsTasksOnCurrentThread() override;
36 double virtualTimeSeconds() const override; 36 double virtualTimeSeconds() const override;
37 double monotonicallyIncreasingVirtualTimeSeconds() const override; 37 double monotonicallyIncreasingVirtualTimeSeconds() const override;
38 std::unique_ptr<WebTaskRunner> clone() override; 38 std::unique_ptr<WebTaskRunner> clone() override;
39 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; 39 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override;
40 40
41 // WebTaskRunner::Task should be wrapped by base::Passed() when 41 // WebTaskRunner::Task should be wrapped by base::Passed() when
42 // used with base::Bind(). See https://crbug.com/551356. 42 // used with base::Bind(). See https://crbug.com/551356.
43 // runTask() is a helper to call WebTaskRunner::Task::run from 43 // runTask() is a helper to call WebTaskRunner::Task::run from
44 // std::unique_ptr<WebTaskRunner::Task>. 44 // std::unique_ptr<WebTaskRunner::Task>.
45 // runTask() is placed here because std::unique_ptr<> cannot be used from 45 // runTask() is placed here because std::unique_ptr<> cannot be used from
46 // Blink. 46 // Blink.
47 static void runTask(std::unique_ptr<WebTaskRunner::Task>); 47 static void runTask(std::unique_ptr<WebTaskRunner::Task>);
48 48
49 private: 49 private:
50 base::TimeTicks Now() const; 50 base::TimeTicks Now() const;
51 51
52 scoped_refptr<TaskQueue> task_queue_; 52 scoped_refptr<TaskQueue> task_queue_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); 54 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
55 }; 55 };
56 56
57 } // namespace scheduler 57 } // namespace scheduler
58 } // namespace blink 58 } // namespace blink
59 59
60 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM PL_H_ 60 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM PL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698