| 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 "wtf/RefPtr.h" | 8 #include "wtf/RefPtr.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WebTaskRunner; | 12 class WebTaskRunner; |
| 13 class WebViewScheduler; | 13 class WebViewScheduler; |
| 14 | 14 |
| 15 class WebFrameScheduler { | 15 class WebFrameScheduler { |
| 16 public: | 16 public: |
| 17 virtual ~WebFrameScheduler() {} | 17 virtual ~WebFrameScheduler() {} |
| 18 | 18 |
| 19 // The scheduler may throttle tasks associated with offscreen frames. | 19 // The scheduler may throttle tasks associated with offscreen frames. |
| 20 virtual void setFrameVisible(bool) {} | 20 virtual void setFrameVisible(bool) {} |
| 21 | 21 |
| 22 // Tells the scheduler that the page this frame belongs to is not visible. | 22 // Tells the scheduler that the page this frame belongs to supposed to be |
| 23 // The scheduler may throttle tasks associated with pages that are not | 23 // throttled (because it's not been visible for a few seconds). |
| 24 // visible. | 24 virtual void setPageThrottled(bool) {} |
| 25 virtual void setPageVisible(bool) {} | |
| 26 | 25 |
| 27 // Set whether this frame is suspended. Only unthrottledTaskRunner tasks are | 26 // Set whether this frame is suspended. Only unthrottledTaskRunner tasks are |
| 28 // allowed to run on a suspended frame. | 27 // allowed to run on a suspended frame. |
| 29 virtual void setSuspended(bool) {} | 28 virtual void setSuspended(bool) {} |
| 30 | 29 |
| 31 // Set whether this frame is cross origin w.r.t. the top level frame. Cross | 30 // Set whether this frame is cross origin w.r.t. the top level frame. Cross |
| 32 // origin frames may use a different scheduling policy from same origin | 31 // origin frames may use a different scheduling policy from same origin |
| 33 // frames. | 32 // frames. |
| 34 virtual void setCrossOrigin(bool) {} | 33 virtual void setCrossOrigin(bool) {} |
| 35 | 34 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 66 virtual void setDocumentParsingInBackground(bool) {} | 65 virtual void setDocumentParsingInBackground(bool) {} |
| 67 | 66 |
| 68 // Tells the scheduler that the first meaningful paint has occured for this | 67 // Tells the scheduler that the first meaningful paint has occured for this |
| 69 // frame. | 68 // frame. |
| 70 virtual void onFirstMeaningfulPaint() {} | 69 virtual void onFirstMeaningfulPaint() {} |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 } // namespace blink | 72 } // namespace blink |
| 74 | 73 |
| 75 #endif // WebFrameScheduler_h | 74 #endif // WebFrameScheduler_h |
| OLD | NEW |