Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h

Issue 2620743002: Don't throttle web views until they've been in the background for 10s (Closed)
Patch Set: Remove tricky to fix but redundant layout test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 disable_background_timer_throttling_; 95 bool disable_background_timer_throttling_;
96 bool allow_virtual_time_to_advance_; 96 bool allow_virtual_time_to_advance_;
97 bool have_seen_loading_task_; 97 bool have_seen_loading_task_;
98 bool virtual_time_; 98 bool virtual_time_;
99 bool is_audio_playing_; 99 bool is_audio_playing_;
100 bool reported_background_throttling_since_navigation_; 100 bool reported_background_throttling_since_navigation_;
101 TaskQueueThrottler::TimeBudgetPool* 101 TaskQueueThrottler::TimeBudgetPool*
102 background_time_budget_pool_; // Not owned. 102 background_time_budget_pool_; // Not owned.
103 CancelableClosureHolder delayed_background_budget_throttling_enabler_; 103 CancelableClosureHolder delayed_background_throttling_enabler_;
104 WebViewScheduler::WebViewSchedulerSettings* settings_; // Not owned. 104 WebViewScheduler::WebViewSchedulerSettings* settings_; // Not owned.
105 105
106 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl); 106 DISALLOW_COPY_AND_ASSIGN(WebViewSchedulerImpl);
107 }; 107 };
108 108
109 } // namespace scheduler 109 } // namespace scheduler
110 } // namespace blink 110 } // namespace blink
111 111
112 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDU LER_IMPL_H_ 112 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_WEB_VIEW_SCHEDU LER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698