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/WebPassOwnPtr.h" | 9 #include "public/platform/WebPassOwnPtr.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
| 13 class WebBlameContext; |
13 class WebFrameScheduler; | 14 class WebFrameScheduler; |
14 | 15 |
15 class BLINK_PLATFORM_EXPORT WebViewScheduler { | 16 class BLINK_PLATFORM_EXPORT WebViewScheduler { |
16 public: | 17 public: |
17 virtual ~WebViewScheduler() { } | 18 virtual ~WebViewScheduler() { } |
18 | 19 |
19 // The scheduler may throttle tasks associated with background pages. | 20 // The scheduler may throttle tasks associated with background pages. |
20 virtual void setPageVisible(bool) = 0; | 21 virtual void setPageVisible(bool) = 0; |
21 | 22 |
22 // Creaters a new WebFrameScheduler, the caller is responsible for deleting
it. | 23 // Creaters a new WebFrameScheduler, the caller is responsible for deleting
it. |
23 virtual WebPassOwnPtr<WebFrameScheduler> createFrameScheduler() = 0; | 24 virtual WebPassOwnPtr<WebFrameScheduler> createFrameScheduler(WebBlameContex
t*) = 0; |
24 | 25 |
25 // Instructs this WebViewScheduler to use virtual time. When virtual time is
enabled | 26 // Instructs this WebViewScheduler to use virtual time. When virtual time is
enabled |
26 // the system doesn't actually sleep for the delays between tasks before exe
cuting | 27 // the system doesn't actually sleep for the delays between tasks before exe
cuting |
27 // them. E.g: A-E are delayed tasks | 28 // them. E.g: A-E are delayed tasks |
28 // | 29 // |
29 // | A B C D E (normal) | 30 // | A B C D E (normal) |
30 // |-----------------------------> time | 31 // |-----------------------------> time |
31 // | 32 // |
32 // |ABCDE (virtual time) | 33 // |ABCDE (virtual time) |
33 // |-----------------------------> time | 34 // |-----------------------------> time |
34 virtual void enableVirtualTime() = 0; | 35 virtual void enableVirtualTime() = 0; |
35 | 36 |
36 // Controls whether or not virtual time is allowed to advance. If virtual ti
me | 37 // Controls whether or not virtual time is allowed to advance. If virtual ti
me |
37 // is not allowed to advance then delayed tasks posted to the WebTaskRunners
owned | 38 // is not allowed to advance then delayed tasks posted to the WebTaskRunners
owned |
38 // by any child WebFrameSchedulers will be paused. If virtual time is allowe
d to | 39 // by any child WebFrameSchedulers will be paused. If virtual time is allowe
d to |
39 // advance then tasks will be run in time order (as usual) but virtual time
will | 40 // advance then tasks will be run in time order (as usual) but virtual time
will |
40 // fast forward so that the system doesn't actually sleep for the delays bet
ween | 41 // fast forward so that the system doesn't actually sleep for the delays bet
ween |
41 // tasks before executing them. | 42 // tasks before executing them. |
42 virtual void setAllowVirtualTimeToAdvance(bool) = 0; | 43 virtual void setAllowVirtualTimeToAdvance(bool) = 0; |
43 }; | 44 }; |
44 | 45 |
45 } // namespace blink | 46 } // namespace blink |
46 | 47 |
47 #endif // WebViewScheduler | 48 #endif // WebViewScheduler |
OLD | NEW |