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.util.SparseArray; |
| 8 |
7 import com.google.common.annotations.VisibleForTesting; | 9 import com.google.common.annotations.VisibleForTesting; |
8 | 10 |
9 import android.util.SparseArray; | |
10 | |
11 import org.chromium.base.SysUtils; | 11 import org.chromium.base.SysUtils; |
12 import org.chromium.base.ThreadUtils; | 12 import org.chromium.base.ThreadUtils; |
13 | 13 |
14 /** | 14 /** |
15 * Manages oom bindings used to bound child services. "Oom binding" is a binding
that raises the | 15 * Manages oom bindings used to bound child services. "Oom binding" is a binding
that raises the |
16 * process oom priority so that it shouldn't be killed by the OS out-of-memory k
iller under | 16 * process oom priority so that it shouldn't be killed by the OS out-of-memory k
iller under |
17 * normal conditions (it can still be killed under drastic memory pressure). Chi
ldProcessConnections | 17 * normal conditions (it can still be killed under drastic memory pressure). Chi
ldProcessConnections |
18 * have two oom bindings: initial binding and strong binding. | 18 * have two oom bindings: initial binding and strong binding. |
19 * | 19 * |
20 * This class serves as a proxy between external calls that manipulate the bindi
ngs and the | 20 * This class serves as a proxy between external calls that manipulate the bindi
ngs and the |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 * ChildProcessConnection. This can be called on any thread. | 273 * ChildProcessConnection. This can be called on any thread. |
274 */ | 274 */ |
275 void clearConnection(int pid) { | 275 void clearConnection(int pid) { |
276 ManagedConnection managedConnection; | 276 ManagedConnection managedConnection; |
277 synchronized (mManagedConnections) { | 277 synchronized (mManagedConnections) { |
278 managedConnection = mManagedConnections.get(pid); | 278 managedConnection = mManagedConnections.get(pid); |
279 } | 279 } |
280 if (managedConnection != null) managedConnection.clearConnection(); | 280 if (managedConnection != null) managedConnection.clearConnection(); |
281 } | 281 } |
282 } | 282 } |
OLD | NEW |