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

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

Issue 2266443002: Optimize posting of WTF::Closure and improve scheduler test mocks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cut back to just the WTF::Closure fix plus the scheduler test mock refactor. 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 15 matching lines...) Expand all
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 bool runsTasksOnCurrentThread() override; 32 bool runsTasksOnCurrentThread() override;
33 double virtualTimeSeconds() const override; 33 double virtualTimeSeconds() const override;
34 double monotonicallyIncreasingVirtualTimeSeconds() const override; 34 double monotonicallyIncreasingVirtualTimeSeconds() const override;
35 std::unique_ptr<WebTaskRunner> clone() override; 35 std::unique_ptr<WebTaskRunner> clone() override;
36 base::SingleThreadTaskRunner* taskRunner() override; 36 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override;
37 37
38 // WebTaskRunner::Task should be wrapped by base::Passed() when 38 // WebTaskRunner::Task should be wrapped by base::Passed() when
39 // used with base::Bind(). See https://crbug.com/551356. 39 // used with base::Bind(). See https://crbug.com/551356.
40 // runTask() is a helper to call WebTaskRunner::Task::run from 40 // runTask() is a helper to call WebTaskRunner::Task::run from
41 // std::unique_ptr<WebTaskRunner::Task>. 41 // std::unique_ptr<WebTaskRunner::Task>.
42 // runTask() is placed here because std::unique_ptr<> cannot be used from 42 // runTask() is placed here because std::unique_ptr<> cannot be used from
43 // Blink. 43 // Blink.
44 static void runTask(std::unique_ptr<WebTaskRunner::Task>); 44 static void runTask(std::unique_ptr<WebTaskRunner::Task>);
45 45
46 private: 46 private:
47 base::TimeTicks Now() const; 47 base::TimeTicks Now() const;
48 48
49 scoped_refptr<TaskQueue> task_queue_; 49 scoped_refptr<TaskQueue> task_queue_;
50 50
51 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); 51 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
52 }; 52 };
53 53
54 } // namespace scheduler 54 } // namespace scheduler
55 } // namespace blink 55 } // namespace blink
56 56
57 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM PL_H_ 57 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM PL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698