Commit 9ffd6254 authored by Shubhie Panicker's avatar Shubhie Panicker Committed by Commit Bot

Decouple Stopped in bg signal from stop loading experiment.

Make triggering of Stopped in bg signal more generic, it should not be
tied to the experiment to stop loading.
A future CL will trigger a JS callback to indicate stopped to the app. 

Bug: 763573
Change-Id: I439e70fab824d2e243ebfa731d5f27464dc629ff
Reviewed-on: https://chromium-review.googlesource.com/736903
Commit-Queue: Shubhie Panicker <panicker@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Reviewed-by: default avatarFadi Meawad <fmeawad@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512690}
parent 890f8aa0
......@@ -1058,6 +1058,8 @@ void RendererSchedulerImpl::UpdatePolicyLocked(UpdateType update_type) {
&new_policy_duration);
}
bool previously_stopped_when_backgrounded =
main_thread_only().stopped_when_backgrounded;
bool newly_stopped = false;
if (main_thread_only().renderer_backgrounded &&
main_thread_only().stopping_when_backgrounded_enabled) {
......@@ -1270,9 +1272,11 @@ void RendererSchedulerImpl::UpdatePolicyLocked(UpdateType update_type) {
// TODO(skyostil): send these notifications after releasing the scheduler
// lock.
if (new_policy.loading_queue_policy().is_stopped !=
main_thread_only().current_policy.loading_queue_policy().is_stopped) {
SetStoppedInBackground(new_policy.loading_queue_policy().is_stopped);
if (main_thread_only().stopping_when_backgrounded_enabled) {
if (main_thread_only().stopped_when_backgrounded !=
previously_stopped_when_backgrounded) {
SetStoppedInBackground(main_thread_only().stopped_when_backgrounded);
}
}
if (new_policy.should_disable_throttling() !=
......
......@@ -528,7 +528,8 @@ void WebFrameSchedulerImpl::UpdateThrottlingState() {
WebFrameScheduler::ThrottlingState
WebFrameSchedulerImpl::CalculateThrottlingState() const {
if (page_stopped_) {
if (RuntimeEnabledFeatures::StopLoadingInBackgroundAndroidEnabled() &&
page_stopped_) {
DCHECK(!page_visible_);
return WebFrameScheduler::ThrottlingState::kStopped;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment