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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.h

Issue 2326313003: Revert of Make canceling Timers fast. (Closed)
Patch Set: 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_TEST_FAKE_WEB_TASK_RUNNER_H _ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H _
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H _ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H _
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "public/platform/WebTaskRunner.h" 9 #include "public/platform/WebTaskRunner.h"
10 #include "wtf/PassRefPtr.h" 10 #include "wtf/PassRefPtr.h"
11 #include "wtf/RefPtr.h" 11 #include "wtf/RefPtr.h"
12 12
13 namespace blink { 13 namespace blink {
14 namespace scheduler { 14 namespace scheduler {
15 15
16 // A dummy WebTaskRunner for tests. 16 // A dummy WebTaskRunner for tests.
17 class FakeWebTaskRunner : public WebTaskRunner { 17 class FakeWebTaskRunner : public WebTaskRunner {
18 public: 18 public:
19 FakeWebTaskRunner(); 19 FakeWebTaskRunner();
20 ~FakeWebTaskRunner() override; 20 ~FakeWebTaskRunner() override;
21 21
22 void setTime(double new_time); 22 void setTime(double new_time);
23 23
24 // WebTaskRunner implementation: 24 // WebTaskRunner implementation:
25 void postTask(const WebTraceLocation&, Task*) override; 25 void postTask(const WebTraceLocation&, Task*) override;
26 void postDelayedTask(const WebTraceLocation&, Task*, double) override; 26 void postDelayedTask(const WebTraceLocation&, Task*, double) override;
27 void postDelayedTask(const WebTraceLocation&,
28 const base::Closure&,
29 double) override;
30 bool runsTasksOnCurrentThread() override; 27 bool runsTasksOnCurrentThread() override;
31 std::unique_ptr<WebTaskRunner> clone() override; 28 std::unique_ptr<WebTaskRunner> clone() override;
32 double virtualTimeSeconds() const override; 29 double virtualTimeSeconds() const override;
33 double monotonicallyIncreasingVirtualTimeSeconds() const override; 30 double monotonicallyIncreasingVirtualTimeSeconds() const override;
34 SingleThreadTaskRunner* toSingleThreadTaskRunner() override; 31 SingleThreadTaskRunner* toSingleThreadTaskRunner() override;
35 32
36 private: 33 private:
37 class Data; 34 class Data;
38 RefPtr<Data> data_; 35 RefPtr<Data> data_;
39 36
40 FakeWebTaskRunner(PassRefPtr<Data> data); 37 FakeWebTaskRunner(PassRefPtr<Data> data);
41 38
42 DISALLOW_COPY_AND_ASSIGN(FakeWebTaskRunner); 39 DISALLOW_COPY_AND_ASSIGN(FakeWebTaskRunner);
43 }; 40 };
44 41
45 } // namespace scheduler 42 } // namespace scheduler
46 } // namespace blink 43 } // namespace blink
47 44
48 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNE R_H_ 45 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698