Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(936)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java

Issue 2795913003: [Merge m58] android: Limit bindToCaller check to webview (Closed)
Patch Set: remove final from chrome Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
index 3f27b404b15c02e7f265f5fe5feb5d51d369681e..aecce853e97b6f8af1b9dec3834ad37cbf559f70 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -405,16 +405,22 @@ public class ChildProcessLauncher {
}
}
+ private static Bundle createCommonParamsBundle(ChildProcessCreationParams params) {
+ Bundle commonParams = new Bundle();
+ commonParams.putParcelable(
+ ChildProcessConstants.EXTRA_LINKER_PARAMS, getLinkerParamsForNewConnection());
+ final boolean bindToCallerCheck = params == null ? false : params.getBindToCallerCheck();
+ commonParams.putBoolean(ChildProcessConstants.EXTRA_BIND_TO_CALLER, bindToCallerCheck);
+ return commonParams;
+ }
+
private static ChildProcessConnection allocateBoundConnection(SpawnData spawnData,
boolean alwaysInForeground, ChildProcessConnection.StartCallback startCallback) {
final Context context = spawnData.context();
final boolean inSandbox = spawnData.inSandbox();
final ChildProcessCreationParams creationParams = spawnData.getCreationParams();
- Bundle commonParams = new Bundle();
- commonParams.putParcelable(
- ChildProcessConstants.EXTRA_LINKER_PARAMS, getLinkerParamsForNewConnection());
- ChildProcessConnection connection =
- allocateConnection(spawnData, commonParams, alwaysInForeground);
+ ChildProcessConnection connection = allocateConnection(spawnData,
+ createCommonParamsBundle(spawnData.getCreationParams()), alwaysInForeground);
if (connection != null) {
connection.start(startCallback);
@@ -664,7 +670,8 @@ public class ChildProcessLauncher {
// Chrome's package to use when initializing a non-renderer processes.
// TODO(boliu): Should fold into |paramId|. Investigate why this is needed.
params = new ChildProcessCreationParams(context.getPackageName(),
- params.getIsExternalService(), params.getLibraryProcessType());
+ params.getIsExternalService(), params.getLibraryProcessType(),
+ params.getBindToCallerCheck());
}
if (ContentSwitches.SWITCH_GPU_PROCESS.equals(processType)) {
callbackType = CALLBACK_FOR_GPU_PROCESS;
@@ -889,16 +896,13 @@ public class ChildProcessLauncher {
}
@VisibleForTesting
- static ChildProcessConnection allocateConnectionForTesting(Context context,
- ChildProcessCreationParams creationParams) {
- Bundle commonParams = new Bundle();
- commonParams.putParcelable(
- ChildProcessConstants.EXTRA_LINKER_PARAMS, getLinkerParamsForNewConnection());
+ static ChildProcessConnection allocateConnectionForTesting(
+ Context context, ChildProcessCreationParams creationParams) {
return allocateConnection(
new SpawnData(false /* forWarmUp */, context, null /* commandLine */,
0 /* childProcessId */, null /* filesToBeMapped */, 0 /* clientContext */,
CALLBACK_FOR_RENDERER_PROCESS, true /* inSandbox */, creationParams),
- commonParams, false);
+ createCommonParamsBundle(creationParams), false);
}
/**

Powered by Google App Engine
This is Rietveld 408576698