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

Side by Side Diff: third_party/WebKit/public/platform/WebTaskRunner.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
« no previous file with comments | « third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "WebCommon.h" 8 #include "WebCommon.h"
9 #include "public/platform/WebTraceLocation.h" 9 #include "public/platform/WebTraceLocation.h"
10 #include <memory> 10 #include <memory>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // real time domain. 59 // real time domain.
60 virtual double virtualTimeSeconds() const = 0; 60 virtual double virtualTimeSeconds() const = 0;
61 61
62 // Returns a microsecond resolution platform dependant time source. 62 // Returns a microsecond resolution platform dependant time source.
63 // This may represent either the real time, or a virtual time depending on 63 // This may represent either the real time, or a virtual time depending on
64 // whether or not the WebTaskRunner is associated with a virtual time domain or a 64 // whether or not the WebTaskRunner is associated with a virtual time domain or a
65 // real time domain. 65 // real time domain.
66 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; 66 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0;
67 67
68 // Returns the underlying task runner object. 68 // Returns the underlying task runner object.
69 virtual SingleThreadTaskRunner* taskRunner() = 0; 69 virtual SingleThreadTaskRunner* toSingleThreadTaskRunner() = 0;
70 70
71 #ifdef INSIDE_BLINK 71 #ifdef INSIDE_BLINK
72 // Helpers for posting bound functions as tasks. 72 // Helpers for posting bound functions as tasks.
73 73
74 // For cross-thread posting. Can be called from any thread. 74 // For cross-thread posting. Can be called from any thread.
75 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); 75 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>);
76 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClo sure>, long long delayMs); 76 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClo sure>, long long delayMs);
77 77
78 // For same-thread posting. Must be called from the associated WebThread. 78 // For same-thread posting. Must be called from the associated WebThread.
79 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); 79 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>);
80 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>, long long delayMs); 80 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>, long long delayMs);
81 #endif 81 #endif
82 }; 82 };
83 83
84 } // namespace blink 84 } // namespace blink
85 85
86 #endif // WebTaskRunner_h 86 #endif // WebTaskRunner_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698