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.content.ComponentName; | 7 import android.content.ComponentName; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.pm.ApplicationInfo; | 9 import android.content.pm.ApplicationInfo; |
10 import android.content.pm.PackageManager; | 10 import android.content.pm.PackageManager; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 linker.getImplementationForTesting()
); | 400 linker.getImplementationForTesting()
); |
401 } else { | 401 } else { |
402 return new ChromiumLinkerParams(sLinkerLoadAddress, | 402 return new ChromiumLinkerParams(sLinkerLoadAddress, |
403 waitForSharedRelros); | 403 waitForSharedRelros); |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 private static ChildProcessConnection allocateBoundConnection(SpawnData spaw
nData, | 407 private static ChildProcessConnection allocateBoundConnection(SpawnData spaw
nData, |
408 boolean alwaysInForeground, ChildProcessConnection.StartCallback sta
rtCallback) { | 408 boolean alwaysInForeground, ChildProcessConnection.StartCallback sta
rtCallback) { |
409 final Context context = spawnData.context(); | 409 final Context context = spawnData.context(); |
410 final String[] commandLine = spawnData.commandLine(); | |
411 final boolean inSandbox = spawnData.inSandbox(); | 410 final boolean inSandbox = spawnData.inSandbox(); |
412 final ChildProcessCreationParams creationParams = spawnData.getCreationP
arams(); | 411 final ChildProcessCreationParams creationParams = spawnData.getCreationP
arams(); |
413 ChromiumLinkerParams chromiumLinkerParams = getLinkerParamsForNewConnect
ion(); | 412 ChromiumLinkerParams chromiumLinkerParams = getLinkerParamsForNewConnect
ion(); |
414 ChildProcessConnection connection = | 413 ChildProcessConnection connection = |
415 allocateConnection(spawnData, chromiumLinkerParams, alwaysInFore
ground); | 414 allocateConnection(spawnData, chromiumLinkerParams, alwaysInFore
ground); |
416 if (connection != null) { | 415 if (connection != null) { |
417 connection.start(commandLine, startCallback); | 416 connection.start(startCallback); |
418 | 417 |
419 String packageName = creationParams != null ? creationParams.getPack
ageName() | 418 String packageName = creationParams != null ? creationParams.getPack
ageName() |
420 : context.getPackageName
(); | 419 : context.getPackageName
(); |
421 if (inSandbox | 420 if (inSandbox |
422 && !getConnectionAllocator(packageName, inSandbox) | 421 && !getConnectionAllocator(packageName, inSandbox) |
423 .isFreeConnectionAvailable()) { | 422 .isFreeConnectionAvailable()) { |
424 // Proactively releases all the moderate bindings once all the s
andboxed services | 423 // Proactively releases all the moderate bindings once all the s
andboxed services |
425 // are allocated, which will be very likely to have some of them
killed by OOM | 424 // are allocated, which will be very likely to have some of them
killed by OOM |
426 // killer. | 425 // killer. |
427 sBindingManager.releaseAllModerateBindings(); | 426 sBindingManager.releaseAllModerateBindings(); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 | 964 |
966 return true; | 965 return true; |
967 } | 966 } |
968 | 967 |
969 private static native void nativeOnChildProcessStarted(long clientContext, i
nt pid); | 968 private static native void nativeOnChildProcessStarted(long clientContext, i
nt pid); |
970 private static native void nativeCompleteScopedSurfaceRequest( | 969 private static native void nativeCompleteScopedSurfaceRequest( |
971 UnguessableToken requestToken, Surface surface); | 970 UnguessableToken requestToken, Surface surface); |
972 private static native boolean nativeIsSingleProcess(); | 971 private static native boolean nativeIsSingleProcess(); |
973 private static native Surface nativeGetViewSurface(int surfaceId); | 972 private static native Surface nativeGetViewSurface(int surfaceId); |
974 } | 973 } |
OLD | NEW |