Commit 656774b9 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

android: Child frame processes in binding management

Child frame process never becomes IMPORTANT even when visible. So change
the condition for adding to moderate binding for becoming visible
instead.

Note in this implementation, there is no guarantee that root frame is
ordered before sub frames in BindingManager.

Bug: 813232
Change-Id: Ia8a7e76c557a59054194f921bfdf1b0cedf5e4be
Reviewed-on: https://chromium-review.googlesource.com/1067516Reviewed-by: default avatarMaria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560359}
parent d93ee216
......@@ -167,6 +167,7 @@ public class ChildProcessLauncherHelper {
// This is the current computed importance from all the inputs from setPriority.
// The initial value is MODERATE since a newly created connection has moderate bindings.
private @ChildProcessImportance int mEffectiveImportance = ChildProcessImportance.MODERATE;
private boolean mForeground;
@CalledByNative
private static FileDescriptorInfo makeFdInfo(
......@@ -477,13 +478,14 @@ public class ChildProcessLauncherHelper {
}
// Add first and remove second.
if (newEffectiveImportance == ChildProcessImportance.IMPORTANT
&& mEffectiveImportance != ChildProcessImportance.IMPORTANT) {
if (foreground && !mForeground) {
BindingManager manager = getBindingManager();
if (mUseBindingManager && manager != null) {
manager.increaseRecency(connection);
}
}
mForeground = foreground;
if (mEffectiveImportance != newEffectiveImportance) {
switch (newEffectiveImportance) {
case ChildProcessImportance.NORMAL:
......
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