| 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; | 7 import android.content.Context; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * background | 25 * background |
| 26 * | 26 * |
| 27 * Thread-safety: most of the methods will be called only on the main thread, ex
ceptions are | 27 * Thread-safety: most of the methods will be called only on the main thread, ex
ceptions are |
| 28 * explicitly noted. | 28 * explicitly noted. |
| 29 */ | 29 */ |
| 30 public interface BindingManager { | 30 public interface BindingManager { |
| 31 /** | 31 /** |
| 32 * Registers a freshly started child process. This can be called on any thre
ad. | 32 * Registers a freshly started child process. This can be called on any thre
ad. |
| 33 * @param pid handle of the service process | 33 * @param pid handle of the service process |
| 34 */ | 34 */ |
| 35 void addNewConnection(int pid, ChildProcessConnection connection); | 35 void addNewConnection(int pid, ManagedChildProcessConnection connection); |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Called when the service visibility changes or is determined for the first
time. On low-memory | 38 * Called when the service visibility changes or is determined for the first
time. On low-memory |
| 39 * devices this will also drop the oom bindings of the last process that was
oom-bound if a new | 39 * devices this will also drop the oom bindings of the last process that was
oom-bound if a new |
| 40 * process is used in foreground. | 40 * process is used in foreground. |
| 41 * @param pid handle of the service process | 41 * @param pid handle of the service process |
| 42 * @param inForeground true iff the service is visibile to the user | 42 * @param inForeground true iff the service is visibile to the user |
| 43 */ | 43 */ |
| 44 void setInForeground(int pid, boolean inForeground); | 44 void setInForeground(int pid, boolean inForeground); |
| 45 | 45 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * Called when the embedding application is brought to foreground. This will
drop the strong | 65 * Called when the embedding application is brought to foreground. This will
drop the strong |
| 66 * binding kept on the main renderer during the background period, so the em
bedder should make | 66 * binding kept on the main renderer during the background period, so the em
bedder should make |
| 67 * sure that this is called after the regular strong binding is attached for
the foreground | 67 * sure that this is called after the regular strong binding is attached for
the foreground |
| 68 * session. | 68 * session. |
| 69 */ | 69 */ |
| 70 void onBroughtToForeground(); | 70 void onBroughtToForeground(); |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * @return True iff the given service process is protected from the out-of-m
emory killing, or it | |
| 74 * was protected when it died unexpectedly. This can be used to decide if a
disconnection of a | |
| 75 * renderer was a crash or a probable out-of-memory kill. This can be called
on any thread. | |
| 76 */ | |
| 77 boolean isOomProtected(int pid); | |
| 78 | |
| 79 /** | |
| 80 * Should be called when the connection to the child process goes away (eith
er after a clean | 73 * Should be called when the connection to the child process goes away (eith
er after a clean |
| 81 * exit or an unexpected crash). At this point we let go of the reference to
the | 74 * exit or an unexpected crash). At this point we let go of the reference to
the |
| 82 * ChildProcessConnection. This can be called on any thread. | 75 * ChildProcessConnection. This can be called on any thread. |
| 83 */ | 76 */ |
| 84 void clearConnection(int pid); | 77 void removeConnection(int pid); |
| 85 | 78 |
| 86 /** | 79 /** |
| 87 * Starts moderate binding management. | 80 * Starts moderate binding management. |
| 88 * Please see https://goo.gl/tl9MQm for details. | 81 * Please see https://goo.gl/tl9MQm for details. |
| 89 */ | 82 */ |
| 90 void startModerateBindingManagement(Context context, int maxSize); | 83 void startModerateBindingManagement(Context context, int maxSize); |
| 91 | 84 |
| 92 /** | 85 /** |
| 93 * Releases all moderate bindings. | 86 * Releases all moderate bindings. |
| 94 */ | 87 */ |
| 95 void releaseAllModerateBindings(); | 88 void releaseAllModerateBindings(); |
| 96 } | 89 } |
| OLD | NEW |