| 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 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class WebFrameScheduler; | 15 class WebFrameScheduler; |
| 16 | 16 |
| 17 class BLINK_PLATFORM_EXPORT WebViewScheduler { | 17 class BLINK_PLATFORM_EXPORT WebViewScheduler { |
| 18 public: | 18 public: |
| 19 // Helper interface to plumb settings from WebSettings to scheduler. |
| 20 class BLINK_PLATFORM_EXPORT WebViewSchedulerSettings { |
| 21 public: |
| 22 virtual ~WebViewSchedulerSettings() {} |
| 23 |
| 24 // Background throttling aggressiveness settings. |
| 25 virtual float expensiveBackgroundThrottlingCPUBudget() = 0; |
| 26 virtual float expensiveBackgroundThrottlingInitialBudget() = 0; |
| 27 virtual float expensiveBackgroundThrottlingMaxBudget() = 0; |
| 28 virtual float expensiveBackgroundThrottlingMaxDelay() = 0; |
| 29 }; |
| 30 |
| 19 virtual ~WebViewScheduler() {} | 31 virtual ~WebViewScheduler() {} |
| 20 | 32 |
| 21 // The scheduler may throttle tasks associated with background pages. | 33 // The scheduler may throttle tasks associated with background pages. |
| 22 virtual void setPageVisible(bool) = 0; | 34 virtual void setPageVisible(bool) = 0; |
| 23 | 35 |
| 24 // Creates a new WebFrameScheduler. The caller is responsible for deleting | 36 // Creates a new WebFrameScheduler. The caller is responsible for deleting |
| 25 // it. All tasks executed by the frame scheduler will be attributed to | 37 // it. All tasks executed by the frame scheduler will be attributed to |
| 26 // |BlameContext|. | 38 // |BlameContext|. |
| 27 virtual std::unique_ptr<WebFrameScheduler> createFrameScheduler( | 39 virtual std::unique_ptr<WebFrameScheduler> createFrameScheduler( |
| 28 BlameContext*) = 0; | 40 BlameContext*) = 0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Sets the virtual time policy, which is applied imemdiatly to all child | 77 // Sets the virtual time policy, which is applied imemdiatly to all child |
| 66 // WebFrameSchedulers. | 78 // WebFrameSchedulers. |
| 67 virtual void setVirtualTimePolicy(VirtualTimePolicy) = 0; | 79 virtual void setVirtualTimePolicy(VirtualTimePolicy) = 0; |
| 68 | 80 |
| 69 virtual void audioStateChanged(bool isAudioPlaying) = 0; | 81 virtual void audioStateChanged(bool isAudioPlaying) = 0; |
| 70 }; | 82 }; |
| 71 | 83 |
| 72 } // namespace blink | 84 } // namespace blink |
| 73 | 85 |
| 74 #endif // WebViewScheduler | 86 #endif // WebViewScheduler |
| OLD | NEW |