| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.content.Context; |
| 8 |
| 7 /** | 9 /** |
| 8 * Manages oom bindings used to bound child services. "Oom binding" is a binding
that raises the | 10 * Manages oom bindings used to bound child services. "Oom binding" is a binding
that raises the |
| 9 * process oom priority so that it shouldn't be killed by the OS out-of-memory k
iller under | 11 * process oom priority so that it shouldn't be killed by the OS out-of-memory k
iller under |
| 10 * normal conditions (it can still be killed under drastic memory pressure). Chi
ldProcessConnections | 12 * normal conditions (it can still be killed under drastic memory pressure). Chi
ldProcessConnections |
| 11 * have two oom bindings: initial binding and strong binding. | 13 * have two oom bindings: initial binding and strong binding. |
| 12 * | 14 * |
| 13 * BindingManager receives calls that signal status of each service (setInForegr
ound(), | 15 * BindingManager receives calls that signal status of each service (setInForegr
ound(), |
| 14 * determinedVisibility()) and the entire embedding application (onSentToBackgro
und(), | 16 * determinedVisibility()) and the entire embedding application (onSentToBackgro
und(), |
| 15 * onBroughtToForeground()) and manipulates child process bindings accordingly. | 17 * onBroughtToForeground()) and manipulates child process bindings accordingly. |
| 16 * | 18 * |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 * renderer was a crash or a probable out-of-memory kill. This can be called
on any thread. | 75 * renderer was a crash or a probable out-of-memory kill. This can be called
on any thread. |
| 74 */ | 76 */ |
| 75 boolean isOomProtected(int pid); | 77 boolean isOomProtected(int pid); |
| 76 | 78 |
| 77 /** | 79 /** |
| 78 * Should be called when the connection to the child process goes away (eith
er after a clean | 80 * Should be called when the connection to the child process goes away (eith
er after a clean |
| 79 * exit or an unexpected crash). At this point we let go of the reference to
the | 81 * exit or an unexpected crash). At this point we let go of the reference to
the |
| 80 * ChildProcessConnection. This can be called on any thread. | 82 * ChildProcessConnection. This can be called on any thread. |
| 81 */ | 83 */ |
| 82 void clearConnection(int pid); | 84 void clearConnection(int pid); |
| 85 |
| 86 /** |
| 87 * Starts moderate binding management. |
| 88 * Please see https://goo.gl/tl9MQm for details. |
| 89 */ |
| 90 void startModerateBindingManagement( |
| 91 Context context, int maxSize, float lowReduceRatio, float highReduce
Ratio); |
| 83 } | 92 } |
| OLD | NEW |