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

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

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase & remove inline keyword Created 3 years, 7 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_TEST_LAZY_SCHEDULER_MESSAGE _LOOP_DELEGATE_FOR_TESTS_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE _LOOP_DELEGATE_FOR_TESTS_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE _LOOP_DELEGATE_FOR_TESTS_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE _LOOP_DELEGATE_FOR_TESTS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 23 matching lines...) Expand all
34 // SchedulerTqmDelegate implementation 34 // SchedulerTqmDelegate implementation
35 void SetDefaultTaskRunner( 35 void SetDefaultTaskRunner(
36 scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; 36 scoped_refptr<base::SingleThreadTaskRunner> task_runner) override;
37 void RestoreDefaultTaskRunner() override; 37 void RestoreDefaultTaskRunner() override;
38 bool PostDelayedTask(const tracked_objects::Location& from_here, 38 bool PostDelayedTask(const tracked_objects::Location& from_here,
39 base::OnceClosure task, 39 base::OnceClosure task,
40 base::TimeDelta delay) override; 40 base::TimeDelta delay) override;
41 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 41 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
42 base::OnceClosure task, 42 base::OnceClosure task,
43 base::TimeDelta delay) override; 43 base::TimeDelta delay) override;
44 bool RunsTasksOnCurrentThread() const override; 44 bool RunsTasksInCurrentSequence() const override;
45 bool IsNested() const override; 45 bool IsNested() const override;
46 void AddNestingObserver(base::RunLoop::NestingObserver* observer) override; 46 void AddNestingObserver(base::RunLoop::NestingObserver* observer) override;
47 void RemoveNestingObserver(base::RunLoop::NestingObserver* observer) override; 47 void RemoveNestingObserver(base::RunLoop::NestingObserver* observer) override;
48 base::TimeTicks NowTicks() override; 48 base::TimeTicks NowTicks() override;
49 49
50 private: 50 private:
51 LazySchedulerMessageLoopDelegateForTests(); 51 LazySchedulerMessageLoopDelegateForTests();
52 ~LazySchedulerMessageLoopDelegateForTests() override; 52 ~LazySchedulerMessageLoopDelegateForTests() override;
53 53
54 bool HasMessageLoop() const; 54 bool HasMessageLoop() const;
55 base::MessageLoop* EnsureMessageLoop() const; 55 base::MessageLoop* EnsureMessageLoop() const;
56 56
57 mutable base::MessageLoop* message_loop_; 57 mutable base::MessageLoop* message_loop_;
58 base::PlatformThreadId thread_id_; 58 base::PlatformThreadId thread_id_;
59 59
60 // A task runner which hasn't yet been overridden in the message loop. 60 // A task runner which hasn't yet been overridden in the message loop.
61 mutable scoped_refptr<base::SingleThreadTaskRunner> pending_task_runner_; 61 mutable scoped_refptr<base::SingleThreadTaskRunner> pending_task_runner_;
62 mutable scoped_refptr<base::SingleThreadTaskRunner> original_task_runner_; 62 mutable scoped_refptr<base::SingleThreadTaskRunner> original_task_runner_;
63 std::unique_ptr<base::TickClock> time_source_; 63 std::unique_ptr<base::TickClock> time_source_;
64 64
65 base::RunLoop::NestingObserver* pending_observer_; 65 base::RunLoop::NestingObserver* pending_observer_;
66 66
67 DISALLOW_COPY_AND_ASSIGN(LazySchedulerMessageLoopDelegateForTests); 67 DISALLOW_COPY_AND_ASSIGN(LazySchedulerMessageLoopDelegateForTests);
68 }; 68 };
69 69
70 } // namespace scheduler 70 } // namespace scheduler
71 } // namespace blink 71 } // namespace blink
72 72
73 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_LAZY_SCHEDULER_MESS AGE_LOOP_DELEGATE_FOR_TESTS_H_ 73 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_LAZY_SCHEDULER_MESS AGE_LOOP_DELEGATE_FOR_TESTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698