| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.annotation.SuppressLint; |
| 7 import android.content.Context; | 8 import android.content.Context; |
| 8 import android.os.Bundle; | 9 import android.os.Bundle; |
| 9 import android.os.IBinder; | 10 import android.os.IBinder; |
| 10 import android.os.RemoteException; | 11 import android.os.RemoteException; |
| 11 | 12 |
| 12 import org.chromium.base.CpuFeatures; | 13 import org.chromium.base.CpuFeatures; |
| 13 import org.chromium.base.Log; | 14 import org.chromium.base.Log; |
| 14 import org.chromium.base.ThreadUtils; | 15 import org.chromium.base.ThreadUtils; |
| 15 import org.chromium.base.TraceEvent; | 16 import org.chromium.base.TraceEvent; |
| 16 import org.chromium.base.VisibleForTesting; | 17 import org.chromium.base.VisibleForTesting; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 private static Map<Integer, BaseChildProcessConnection> sServiceMap = | 184 private static Map<Integer, BaseChildProcessConnection> sServiceMap = |
| 184 new ConcurrentHashMap<Integer, BaseChildProcessConnection>(); | 185 new ConcurrentHashMap<Integer, BaseChildProcessConnection>(); |
| 185 | 186 |
| 186 // These variables are used for the warm up sandboxed connection. | 187 // These variables are used for the warm up sandboxed connection. |
| 187 // |sSpareSandboxedConnection| is non-null when there is a pending connectio
n. Note it's cleared | 188 // |sSpareSandboxedConnection| is non-null when there is a pending connectio
n. Note it's cleared |
| 188 // to null again after the connection is used for a real child process. | 189 // to null again after the connection is used for a real child process. |
| 189 // |sSpareConnectionStarting| is true if ChildProcessConnection.StartCallbac
k has not fired. | 190 // |sSpareConnectionStarting| is true if ChildProcessConnection.StartCallbac
k has not fired. |
| 190 // This is used for a child process allocation to determine if StartCallback
should be chained. | 191 // This is used for a child process allocation to determine if StartCallback
should be chained. |
| 191 // |sSpareConnectionStartCallback| is the chained StartCallback. This is als
o used to determine | 192 // |sSpareConnectionStartCallback| is the chained StartCallback. This is als
o used to determine |
| 192 // if there is already a child process launch that's used this this connecti
on. | 193 // if there is already a child process launch that's used this this connecti
on. |
| 194 @SuppressLint("StaticFieldLeak") |
| 193 private static BaseChildProcessConnection sSpareSandboxedConnection; | 195 private static BaseChildProcessConnection sSpareSandboxedConnection; |
| 194 private static boolean sSpareConnectionStarting; | 196 private static boolean sSpareConnectionStarting; |
| 195 private static BaseChildProcessConnection.StartCallback sSpareConnectionStar
tCallback; | 197 private static BaseChildProcessConnection.StartCallback sSpareConnectionStar
tCallback; |
| 196 | 198 |
| 197 // Manages oom bindings used to bind chind services. Lazily initialized by g
etBindingManager() | 199 // Manages oom bindings used to bind chind services. Lazily initialized by g
etBindingManager() |
| 198 private static BindingManager sBindingManager; | 200 private static BindingManager sBindingManager; |
| 199 | 201 |
| 200 // Whether the main application is currently brought to the foreground. | 202 // Whether the main application is currently brought to the foreground. |
| 201 private static boolean sApplicationInForeground = true; | 203 private static boolean sApplicationInForeground = true; |
| 202 | 204 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 553 |
| 552 try { | 554 try { |
| 553 ((ManagedChildProcessConnection) sServiceMap.get(pid)).crashServiceF
orTesting(); | 555 ((ManagedChildProcessConnection) sServiceMap.get(pid)).crashServiceF
orTesting(); |
| 554 } catch (RemoteException ex) { | 556 } catch (RemoteException ex) { |
| 555 return false; | 557 return false; |
| 556 } | 558 } |
| 557 | 559 |
| 558 return true; | 560 return true; |
| 559 } | 561 } |
| 560 } | 562 } |
| OLD | NEW |