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 WebFrameScheduler_h | 5 #ifndef WebFrameScheduler_h |
6 #define WebFrameScheduler_h | 6 #define WebFrameScheduler_h |
7 | 7 |
8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class WebSecurityOrigin; | 14 class WebSecurityOrigin; |
15 class WebTaskRunner; | 15 class WebTaskRunner; |
16 class WebViewScheduler; | 16 class WebViewScheduler; |
17 | 17 |
18 class BLINK_PLATFORM_EXPORT WebFrameScheduler { | 18 class BLINK_PLATFORM_EXPORT WebFrameScheduler { |
19 public: | 19 public: |
20 virtual ~WebFrameScheduler() { } | 20 virtual ~WebFrameScheduler() { } |
21 | 21 |
22 // The scheduler may throttle tasks associated with offscreen frames. | 22 // The scheduler may throttle tasks associated with offscreen frames. |
23 virtual void setFrameVisible(bool) { } | 23 virtual void setFrameVisible(bool) { } |
24 | 24 |
25 // Tells the scheduler that the page this frame belongs to is not visible. | 25 // Tells the scheduler that the page this frame belongs to is not visible. |
26 // The scheduler may throttle tasks associated with pages that are not visib
le. | 26 // The scheduler may throttle tasks associated with pages that are not visib
le. |
27 virtual void setPageVisible(bool) { } | 27 virtual void setPageVisible(bool) { } |
28 | 28 |
| 29 // Set whether this frame is cross origin w.r.t. the top level frame. Cross |
| 30 // origin frames may use a different scheduling policy from same origin |
| 31 // frames. |
| 32 virtual void setCrossOrigin(bool) {} |
| 33 |
29 // Returns the WebTaskRunner for loading tasks. | 34 // Returns the WebTaskRunner for loading tasks. |
30 // WebFrameScheduler owns the returned WebTaskRunner. | 35 // WebFrameScheduler owns the returned WebTaskRunner. |
31 virtual WebTaskRunner* loadingTaskRunner() { return nullptr; } | 36 virtual WebTaskRunner* loadingTaskRunner() { return nullptr; } |
32 | 37 |
33 // Returns the WebTaskRunner for timer tasks. | 38 // Returns the WebTaskRunner for timer tasks. |
34 // WebFrameScheduler owns the returned WebTaskRunner. | 39 // WebFrameScheduler owns the returned WebTaskRunner. |
35 virtual WebTaskRunner* timerTaskRunner() { return nullptr; } | 40 virtual WebTaskRunner* timerTaskRunner() { return nullptr; } |
36 | 41 |
37 // Returns the WebTaskRunner for tasks which should never get throttled. | 42 // Returns the WebTaskRunner for tasks which should never get throttled. |
38 // This is generally used for executing internal browser tasks which should | 43 // This is generally used for executing internal browser tasks which should |
(...skipping 16 matching lines...) Expand all Loading... |
55 | 60 |
56 // Tells the scheduler if we are parsing a document on another thread. This | 61 // Tells the scheduler if we are parsing a document on another thread. This |
57 // tells the scheduler not to advance virtual time if it's using the | 62 // tells the scheduler not to advance virtual time if it's using the |
58 // DETERMINISTIC_LOADING policy. | 63 // DETERMINISTIC_LOADING policy. |
59 virtual void setDocumentParsingInBackground(bool) {} | 64 virtual void setDocumentParsingInBackground(bool) {} |
60 }; | 65 }; |
61 | 66 |
62 } // namespace blink | 67 } // namespace blink |
63 | 68 |
64 #endif // WebFrameScheduler_h | 69 #endif // WebFrameScheduler_h |
OLD | NEW |