Commit 07fe724b authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

Android process binding fixes

* Add back boostForPendingView logic accidentally removed in r554797
* Send updates when frame depth changes, which was missing in r546622.
  Note this fix is limited to OS_ANDROID to maintain the desktop
  workaround for crbug.com/560446
* Also improve testCrossDomainNavigationDoNotLoseImportance to also
  log the calling stack on failure.

Bug: 861826
Change-Id: I0757647a81228a9bfc5fda02d775f62fb6bee723
Reviewed-on: https://chromium-review.googlesource.com/1128573Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573540}
parent 39c6286b
......@@ -4050,6 +4050,13 @@ void RenderProcessHostImpl::UpdateProcessPriorityInputs() {
}
bool inputs_changed = new_visible_widgets_count != visible_clients_;
#if defined(OS_ANDROID)
// OS_ANDROID in order to maintain the workaround on desktop to avoid
// backgrounding a new process. See the comment in OnProcessLaunched and
// https://crbug.com/560446. Only android uses frame_depth for now, so
// not a huge change.
inputs_changed = inputs_changed || frame_depth_ != new_frame_depth;
#endif
visible_clients_ = new_visible_widgets_count;
frame_depth_ = new_frame_depth;
#if defined(OS_ANDROID)
......
......@@ -460,7 +460,7 @@ public final class ChildProcessLauncherHelperImpl {
int newEffectiveImportance;
if ((foreground && frameDepth == 0) || importance == ChildProcessImportance.IMPORTANT) {
newEffectiveImportance = ChildProcessImportance.IMPORTANT;
} else if ((foreground && frameDepth > 0)
} else if ((foreground && frameDepth > 0) || boostForPendingViews
|| importance == ChildProcessImportance.MODERATE) {
newEffectiveImportance = ChildProcessImportance.MODERATE;
} else {
......
......@@ -93,7 +93,7 @@ public class ChildProcessLauncherIntegrationTest {
public void throwIfDroppedBothModerateAndStrongBinding() {
if (mRemovedBothModerateAndStrongBinding != null) {
throw mRemovedBothModerateAndStrongBinding;
throw new RuntimeException(mRemovedBothModerateAndStrongBinding);
}
}
}
......
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