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

Side by Side Diff: third_party/WebKit/public/platform/WebViewScheduler.h

Issue 2725633002: scheduler: Suspend timers while virtual time is paused (Closed)
Patch Set: Rebased Created 3 years, 9 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/web/tests/VirtualTimeTest.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 WebViewScheduler_h 5 #ifndef WebViewScheduler_h
6 #define WebViewScheduler_h 6 #define WebViewScheduler_h
7 7
8 #include "WebCommon.h" 8 #include "WebCommon.h"
9 #include "public/platform/BlameContext.h" 9 #include "public/platform/BlameContext.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // enabled the system doesn't actually sleep for the delays between tasks 43 // enabled the system doesn't actually sleep for the delays between tasks
44 // before executing them. E.g: A-E are delayed tasks 44 // before executing them. E.g: A-E are delayed tasks
45 // 45 //
46 // | A B C D E (normal) 46 // | A B C D E (normal)
47 // |-----------------------------> time 47 // |-----------------------------> time
48 // 48 //
49 // |ABCDE (virtual time) 49 // |ABCDE (virtual time)
50 // |-----------------------------> time 50 // |-----------------------------> time
51 virtual void enableVirtualTime() = 0; 51 virtual void enableVirtualTime() = 0;
52 52
53 // Disables virtual time. Note that this is only used for testing, because
54 // there's no reason to do this in production.
55 virtual void disableVirtualTimeForTesting() = 0;
56
53 // Returns true if virtual time is currently allowed to advance. 57 // Returns true if virtual time is currently allowed to advance.
54 virtual bool virtualTimeAllowedToAdvance() const = 0; 58 virtual bool virtualTimeAllowedToAdvance() const = 0;
55 59
56 enum class VirtualTimePolicy { 60 enum class VirtualTimePolicy {
57 // In this policy virtual time is allowed to advance. If the blink scheduler 61 // In this policy virtual time is allowed to advance. If the blink scheduler
58 // runs out of immediate work, the virtual timebase will be incremented so 62 // runs out of immediate work, the virtual timebase will be incremented so
59 // that the next sceduled timer may fire. NOTE Tasks will be run in time 63 // that the next sceduled timer may fire. NOTE Tasks will be run in time
60 // order (as usual). 64 // order (as usual).
61 ADVANCE, 65 ADVANCE,
62 66
(...skipping 16 matching lines...) Expand all
79 virtual void setVirtualTimePolicy(VirtualTimePolicy) = 0; 83 virtual void setVirtualTimePolicy(VirtualTimePolicy) = 0;
80 84
81 virtual void audioStateChanged(bool isAudioPlaying) = 0; 85 virtual void audioStateChanged(bool isAudioPlaying) = 0;
82 86
83 virtual bool hasActiveConnectionForTest() const = 0; 87 virtual bool hasActiveConnectionForTest() const = 0;
84 }; 88 };
85 89
86 } // namespace blink 90 } // namespace blink
87 91
88 #endif // WebViewScheduler 92 #endif // WebViewScheduler
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698