| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |