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

Side by Side Diff: third_party/WebKit/Source/platform/WebTaskRunner.h

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: remove RunsTasksOnCurrentThread() overrided. Created 3 years, 8 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 WebTaskRunner_h 5 #ifndef WebTaskRunner_h
6 #define WebTaskRunner_h 6 #define WebTaskRunner_h
7 7
8 #include <memory> 8 #include <memory>
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "public/platform/WebCommon.h" 10 #include "public/platform/WebCommon.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // The blink representation of a chromium SingleThreadTaskRunner. 58 // The blink representation of a chromium SingleThreadTaskRunner.
59 class BLINK_PLATFORM_EXPORT WebTaskRunner 59 class BLINK_PLATFORM_EXPORT WebTaskRunner
60 : public ThreadSafeRefCounted<WebTaskRunner> { 60 : public ThreadSafeRefCounted<WebTaskRunner> {
61 public: 61 public:
62 // Schedule a task to be run after |delayMs| on the the associated WebThread. 62 // Schedule a task to be run after |delayMs| on the the associated WebThread.
63 // Can be called from any thread. 63 // Can be called from any thread.
64 virtual void PostDelayedTask(const WebTraceLocation&, 64 virtual void PostDelayedTask(const WebTraceLocation&,
65 base::OnceClosure, 65 base::OnceClosure,
66 double delay_ms) = 0; 66 double delay_ms) = 0;
67 67
68 // Returns true if the current thread is a thread on which a task may be run. 68 // Returns true if the current thread is a thread on which a task may be run.
gab 2017/04/18 15:00:33 Update interface comment.
69 // Can be called from any thread. 69 // Can be called from any thread.
70 virtual bool RunsTasksOnCurrentThread() = 0; 70 bool RunsTasksOnCurrentThread();
71 virtual bool RunsTasksInCurrentSequence() = 0;
71 72
72 // --- 73 // ---
73 74
74 // Headless Chrome virtualises time for determinism and performance (fast 75 // Headless Chrome virtualises time for determinism and performance (fast
75 // forwarding of timers). To make this work some parts of blink (e.g. Timers) 76 // forwarding of timers). To make this work some parts of blink (e.g. Timers)
76 // need to use virtual time, however by default new code should use the normal 77 // need to use virtual time, however by default new code should use the normal
77 // non-virtual time APIs. 78 // non-virtual time APIs.
78 79
79 // Returns a double which is the number of seconds since epoch (Jan 1, 1970). 80 // Returns a double which is the number of seconds since epoch (Jan 1, 1970).
80 // This may represent either the real time, or a virtual time depending on 81 // This may represent either the real time, or a virtual time depending on
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 WebTaskRunner() = default; 120 WebTaskRunner() = default;
120 virtual ~WebTaskRunner(); 121 virtual ~WebTaskRunner();
121 122
122 private: 123 private:
123 DISALLOW_COPY_AND_ASSIGN(WebTaskRunner); 124 DISALLOW_COPY_AND_ASSIGN(WebTaskRunner);
124 }; 125 };
125 126
126 } // namespace blink 127 } // namespace blink
127 128
128 #endif // WebTaskRunner_h 129 #endif // WebTaskRunner_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698