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

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

Issue 12321131: Renamed Sandboxed process to Child process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebaesed and removed stub SandboxedProcessService Created 7 years, 9 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/ChildProcessConnection.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/SandboxedProcessConnection.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java
similarity index 91%
rename from content/public/android/java/src/org/chromium/content/browser/SandboxedProcessConnection.java
rename to content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java
index 53d531827e8fbec81637440597078096f1c86b80..433e3f1deeaaa79c6242de2354673ba8ad50c4c2 100644
--- a/content/public/android/java/src/org/chromium/content/browser/SandboxedProcessConnection.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java
@@ -23,13 +23,13 @@ import org.chromium.base.CalledByNative;
import org.chromium.base.CpuFeatures;
import org.chromium.base.ThreadUtils;
import org.chromium.content.common.CommandLine;
-import org.chromium.content.common.ISandboxedProcessCallback;
-import org.chromium.content.common.ISandboxedProcessService;
+import org.chromium.content.common.IChildProcessCallback;
+import org.chromium.content.common.IChildProcessService;
import org.chromium.content.common.TraceEvent;
-public class SandboxedProcessConnection implements ServiceConnection {
+public class ChildProcessConnection implements ServiceConnection {
interface DeathCallback {
- void onSandboxedProcessDied(int pid);
+ void onChildProcessDied(int pid);
}
// Names of items placed in the bind intent or connection bundle.
@@ -52,30 +52,30 @@ public class SandboxedProcessConnection implements ServiceConnection {
private final Context mContext;
private final int mServiceNumber;
- private final SandboxedProcessConnection.DeathCallback mDeathCallback;
+ private final ChildProcessConnection.DeathCallback mDeathCallback;
// Synchronization: While most internal flow occurs on the UI thread, the public API
// (specifically bind and unbind) may be called from any thread, hence all entry point methods
- // into the class are synchronized on the SandboxedProcessConnection instance to protect access
+ // into the class are synchronized on the ChildProcessConnection instance to protect access
// to these members. But see also the TODO where AsyncBoundServiceConnection is created.
- private ISandboxedProcessService mService = null;
+ private IChildProcessService mService = null;
private boolean mServiceConnectComplete = false;
private int mPID = 0; // Process ID of the corresponding sandboxed process.
private HighPriorityConnection mHighPriorityConnection = null;
private int mHighPriorityConnectionCount = 0;
- private static final String TAG = "SandboxedProcessConnection";
+ private static final String TAG = "ChildProcessConnection";
private static class ConnectionParams {
final String[] mCommandLine;
final FileDescriptorInfo[] mFilesToBeMapped;
- final ISandboxedProcessCallback mCallback;
+ final IChildProcessCallback mCallback;
final Runnable mOnConnectionCallback;
ConnectionParams(
String[] commandLine,
FileDescriptorInfo[] filesToBeMapped,
- ISandboxedProcessCallback callback,
+ IChildProcessCallback callback,
Runnable onConnectionCallback) {
mCommandLine = commandLine;
mFilesToBeMapped = filesToBeMapped;
@@ -88,8 +88,8 @@ public class SandboxedProcessConnection implements ServiceConnection {
private ConnectionParams mConnectionParams;
private boolean mIsBound;
- SandboxedProcessConnection(Context context, int number,
- SandboxedProcessConnection.DeathCallback deathCallback) {
+ ChildProcessConnection(Context context, int number,
+ ChildProcessConnection.DeathCallback deathCallback) {
mContext = context;
mServiceNumber = number;
mDeathCallback = deathCallback;
@@ -99,20 +99,21 @@ public class SandboxedProcessConnection implements ServiceConnection {
return mServiceNumber;
}
- synchronized ISandboxedProcessService getService() {
+ synchronized IChildProcessService getService() {
return mService;
}
private Intent createServiceBindIntent() {
Intent intent = new Intent();
- String n = org.chromium.content.app.SandboxedProcessService.class.getName();
+ String n = org.chromium.content.app.SandboxedProcessService0.class.getName()
+ .replaceAll("[0-9]*$", "");
intent.setClassName(mContext, n + mServiceNumber);
intent.setPackage(mContext.getPackageName());
return intent;
}
/**
- * Bind to an ISandboxedProcessService. This must be followed by a call to setupConnection()
+ * Bind to an IChildProcessService. This must be followed by a call to setupConnection()
* to setup the connection parameters. (These methods are separated to allow the client
* to pass whatever parameters they have available here, and complete the remainder
* later while reducing the connection setup latency).
@@ -150,7 +151,7 @@ public class SandboxedProcessConnection implements ServiceConnection {
synchronized void setupConnection(
String[] commandLine,
FileDescriptorInfo[] filesToBeMapped,
- ISandboxedProcessCallback callback,
+ IChildProcessCallback callback,
Runnable onConnectionCallback) {
TraceEvent.begin();
assert mConnectionParams == null;
@@ -163,7 +164,7 @@ public class SandboxedProcessConnection implements ServiceConnection {
}
/**
- * Unbind the ISandboxedProcessService. It is safe to call this multiple times.
+ * Unbind the IChildProcessService. It is safe to call this multiple times.
*/
synchronized void unbind() {
if (mIsBound) {
@@ -186,7 +187,7 @@ public class SandboxedProcessConnection implements ServiceConnection {
public void onServiceConnected(ComponentName className, IBinder service) {
TraceEvent.begin();
mServiceConnectComplete = true;
- mService = ISandboxedProcessService.Stub.asInterface(service);
+ mService = IChildProcessService.Stub.asInterface(service);
if (mConnectionParams != null) {
doConnectionSetup();
}
@@ -279,7 +280,7 @@ public class SandboxedProcessConnection implements ServiceConnection {
Log.w(TAG, "onServiceDisconnected (crash?): pid=" + pid);
unbind(); // We don't want to auto-restart on crash. Let the browser do that.
if (pid != 0) {
- mDeathCallback.onSandboxedProcessDied(pid);
+ mDeathCallback.onChildProcessDied(pid);
}
if (onConnectionCallback != null) {
onConnectionCallback.run();

Powered by Google App Engine
This is Rietveld 408576698