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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER
_IMPL_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER
_IMPL_H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER
_IMPL_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDULER
_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void MaybeInitializeBackgroundTimeBudgetPool(); | 72 void MaybeInitializeBackgroundTimeBudgetPool(); |
73 | 73 |
74 void setAllowVirtualTimeToAdvance(bool allow_virtual_time_to_advance); | 74 void setAllowVirtualTimeToAdvance(bool allow_virtual_time_to_advance); |
75 void ApplyVirtualTimePolicy(); | 75 void ApplyVirtualTimePolicy(); |
76 | 76 |
77 void OnThrottlingReported(base::TimeDelta throttling_duration); | 77 void OnThrottlingReported(base::TimeDelta throttling_duration); |
78 | 78 |
79 static const char* VirtualTimePolicyToString( | 79 static const char* VirtualTimePolicyToString( |
80 VirtualTimePolicy virtual_time_policy); | 80 VirtualTimePolicy virtual_time_policy); |
81 | 81 |
82 // Depending on page visibility, either turns budget throttling off, or | 82 // Depending on page visibility, either turns throttling off, or schedules a |
83 // schedules a call to enable it after a grace period. | 83 // call to enable it after a grace period. |
84 void UpdateBackgroundBudgetThrottlingState(); | 84 void UpdateBackgroundThrottlingState(); |
85 | 85 |
86 void EnableBackgroundBudgetThrottling(); | 86 void EnableBackgroundThrottling(); |
87 | 87 |
88 std::set<WebFrameSchedulerImpl*> frame_schedulers_; | 88 std::set<WebFrameSchedulerImpl*> frame_schedulers_; |
89 std::set<unsigned long> pending_loads_; | 89 std::set<unsigned long> pending_loads_; |
90 WebScheduler::InterventionReporter* intervention_reporter_; // Not owned. | 90 WebScheduler::InterventionReporter* intervention_reporter_; // Not owned. |
91 RendererSchedulerImpl* renderer_scheduler_; | 91 RendererSchedulerImpl* renderer_scheduler_; |
92 VirtualTimePolicy virtual_time_policy_; | 92 VirtualTimePolicy virtual_time_policy_; |
93 int background_parser_count_; | 93 int background_parser_count_; |
94 bool page_visible_; | 94 bool page_visible_; |
| 95 bool should_throttle_frames_; |
95 bool disable_background_timer_throttling_; | 96 bool disable_background_timer_throttling_; |
96 bool allow_virtual_time_to_advance_; | 97 bool allow_virtual_time_to_advance_; |
97 bool have_seen_loading_task_; | 98 bool have_seen_loading_task_; |
98 bool virtual_time_; | 99 bool virtual_time_; |
99 bool is_audio_playing_; | 100 bool is_audio_playing_; |
100 bool reported_background_throttling_since_navigation_; | 101 bool reported_background_throttling_since_navigation_; |
101 TaskQueueThrottler::TimeBudgetPool* | 102 TaskQueueThrottler::TimeBudgetPool* |
102 background_time_budget_pool_; // Not owned. | 103 background_time_budget_pool_; // Not owned. |
103 CancelableClosureHolder delayed_background_budget_throttling_enabler_; | 104 CancelableClosureHolder delayed_background_throttling_enabler_; |
104 WebViewScheduler::WebViewSchedulerSettings* settings_; // Not owned. | 105 WebViewScheduler::WebViewSchedulerSettings* settings_; // Not owned. |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); | 107 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); |
107 }; | 108 }; |
108 | 109 |
109 } // namespace scheduler | 110 } // namespace scheduler |
110 } // namespace blink | 111 } // namespace blink |
111 | 112 |
112 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDU
LER_IMPL_H_ | 113 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDU
LER_IMPL_H_ |
OLD | NEW |