Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java b/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| similarity index 81% |
| copy from content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java |
| copy to content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| index d89cce140e7aab74fb08fec4bc769e02242c26f0..8b3519be4fdad01c38634629476c8a794939f12c 100644 |
| --- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java |
| +++ b/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| @@ -21,9 +21,9 @@ import java.util.ArrayList; |
| import org.chromium.base.CalledByNative; |
| import org.chromium.base.JNINamespace; |
| import org.chromium.content.app.ContentMain; |
| -import org.chromium.content.browser.SandboxedProcessConnection; |
| -import org.chromium.content.common.ISandboxedProcessCallback; |
| -import org.chromium.content.common.ISandboxedProcessService; |
| +import org.chromium.content.browser.ChildProcessConnection; |
| +import org.chromium.content.common.IChildProcessCallback; |
| +import org.chromium.content.common.IChildProcessService; |
| import org.chromium.content.common.ProcessInitException; |
| import org.chromium.content.common.SurfaceCallback; |
| @@ -35,13 +35,13 @@ import org.chromium.content.common.SurfaceCallback; |
| * of its AndroidManifest.xml, for example with N entries of the form:- |
| * <service android:name="org.chromium.content.app.SandboxedProcessServiceX" |
|
joth
2013/03/06 17:48:03
Why aren't SandboxedProcessService0 ... SandboxedP
kjyoun
2013/03/07 11:40:00
SandboxedProcessService0..5 is not renamed, since
joth
2013/03/07 19:58:54
OK I got that now. Makes sense to handle this in s
|
| * android:process=":sandboxed_processX" /> |
| - * for X in 0...N-1 (where N is {@link SandboxedProcessLauncher#MAX_REGISTERED_SERVICES}) |
| + * for X in 0...N-1 (where N is {@link ChildProcessLauncher#MAX_REGISTERED_SERVICES}) |
| */ |
| @JNINamespace("content") |
| -public class SandboxedProcessService extends Service { |
| - private static final String MAIN_THREAD_NAME = "SandboxedProcessMain"; |
| - private static final String TAG = "SandboxedProcessService"; |
| - private ISandboxedProcessCallback mCallback; |
| +public class ChildProcessService extends Service { |
| + private static final String MAIN_THREAD_NAME = "ChildProcessMain"; |
| + private static final String TAG = "ChildProcessService"; |
| + private IChildProcessCallback mCallback; |
| // This is the native "Main" thread for the renderer / utility process. |
| private Thread mSandboxMainThread; |
| @@ -58,36 +58,36 @@ public class SandboxedProcessService extends Service { |
| private boolean mLibraryInitialized = false; |
| // Binder object used by clients for this service. |
| - private final ISandboxedProcessService.Stub mBinder = new ISandboxedProcessService.Stub() { |
| - // NOTE: Implement any ISandboxedProcessService methods here. |
| + private final IChildProcessService.Stub mBinder = new IChildProcessService.Stub() { |
| + // NOTE: Implement any IChildProcessService methods here. |
| @Override |
| - public int setupConnection(Bundle args, ISandboxedProcessCallback callback) { |
| + public int setupConnection(Bundle args, IChildProcessCallback callback) { |
| mCallback = callback; |
| synchronized (mSandboxMainThread) { |
| // Allow the command line to be set via bind() intent or setupConnection, but |
| // the FD can only be transferred here. |
| if (mCommandLineParams == null) { |
| mCommandLineParams = args.getStringArray( |
| - SandboxedProcessConnection.EXTRA_COMMAND_LINE); |
| + ChildProcessConnection.EXTRA_COMMAND_LINE); |
| } |
| // We must have received the command line by now |
| assert mCommandLineParams != null; |
| - mCpuCount = args.getInt(SandboxedProcessConnection.EXTRA_CPU_COUNT); |
| - mCpuFeatures = args.getLong(SandboxedProcessConnection.EXTRA_CPU_FEATURES); |
| + mCpuCount = args.getInt(ChildProcessConnection.EXTRA_CPU_COUNT); |
| + mCpuFeatures = args.getLong(ChildProcessConnection.EXTRA_CPU_FEATURES); |
| assert mCpuCount > 0; |
| mFileIds = new ArrayList<Integer>(); |
| mFileFds = new ArrayList<ParcelFileDescriptor>(); |
| for (int i = 0;; i++) { |
| - String fdName = SandboxedProcessConnection.EXTRA_FILES_PREFIX + i |
| - + SandboxedProcessConnection.EXTRA_FILES_FD_SUFFIX; |
| + String fdName = ChildProcessConnection.EXTRA_FILES_PREFIX + i |
| + + ChildProcessConnection.EXTRA_FILES_FD_SUFFIX; |
| ParcelFileDescriptor parcel = args.getParcelable(fdName); |
| if (parcel == null) { |
| // End of the file list. |
| break; |
| } |
| mFileFds.add(parcel); |
| - String idName = SandboxedProcessConnection.EXTRA_FILES_PREFIX + i |
| - + SandboxedProcessConnection.EXTRA_FILES_ID_SUFFIX; |
| + String idName = ChildProcessConnection.EXTRA_FILES_PREFIX + i |
| + + ChildProcessConnection.EXTRA_FILES_ID_SUFFIX; |
| mFileIds.add(args.getInt(idName)); |
| } |
| mSandboxMainThread.notifyAll(); |
| @@ -108,7 +108,7 @@ public class SandboxedProcessService extends Service { |
| @Override |
| public void onCreate() { |
| - Log.i(TAG, "Creating new SandboxedProcessService pid=" + Process.myPid()); |
| + Log.i(TAG, "Creating new ChildProcessService pid=" + Process.myPid()); |
| if (sContext != null) { |
| Log.e(TAG, "SanboxedProcessService created again in process!"); |
| } |
| @@ -147,11 +147,11 @@ public class SandboxedProcessService extends Service { |
| fileFds[i] = mFileFds.get(i).detachFd(); |
| } |
| ContentMain.initApplicationContext(sContext.getApplicationContext()); |
| - nativeInitSandboxedProcess(sContext.getApplicationContext(), |
| - SandboxedProcessService.this, fileIds, fileFds, |
| + nativeInitChildProcess(sContext.getApplicationContext(), |
| + ChildProcessService.this, fileIds, fileFds, |
| mCpuCount, mCpuFeatures); |
| ContentMain.start(); |
| - nativeExitSandboxedProcess(); |
| + nativeExitChildProcess(); |
| } catch (InterruptedException e) { |
| Log.w(TAG, MAIN_THREAD_NAME + " startup failed: " + e); |
| } catch (ProcessInitException e) { |
| @@ -164,7 +164,7 @@ public class SandboxedProcessService extends Service { |
| @Override |
| public void onDestroy() { |
| - Log.i(TAG, "Destroying SandboxedProcessService pid=" + Process.myPid()); |
| + Log.i(TAG, "Destroying ChildProcessService pid=" + Process.myPid()); |
| super.onDestroy(); |
| if (mCommandLineParams == null) { |
| // This process was destroyed before it even started. Nothing more to do. |
| @@ -195,9 +195,9 @@ public class SandboxedProcessService extends Service { |
| synchronized (mSandboxMainThread) { |
| mNativeLibraryName = intent.getStringExtra( |
| - SandboxedProcessConnection.EXTRA_NATIVE_LIBRARY_NAME); |
| + ChildProcessConnection.EXTRA_NATIVE_LIBRARY_NAME); |
| mCommandLineParams = intent.getStringArrayExtra( |
| - SandboxedProcessConnection.EXTRA_COMMAND_LINE); |
| + ChildProcessConnection.EXTRA_COMMAND_LINE); |
| mSandboxMainThread.notifyAll(); |
| } |
| @@ -252,19 +252,19 @@ public class SandboxedProcessService extends Service { |
| * it will not return until the sandboxed process exits. See sandboxed_process_service.{h,cc} |
| * |
| * @param applicationContext The Application Context of the current process. |
| - * @param service The current SandboxedProcessService object. |
| + * @param service The current ChildProcessService object. |
| * @param fileIds A list of file IDs that should be registered for access by the renderer. |
| * @param fileFds A list of file descriptors that should be registered for access by the |
| * renderer. |
| */ |
| - private static native void nativeInitSandboxedProcess(Context applicationContext, |
| - SandboxedProcessService service, int[] extraFileIds, int[] extraFileFds, |
| + private static native void nativeInitChildProcess(Context applicationContext, |
| + ChildProcessService service, int[] extraFileIds, int[] extraFileFds, |
| int cpuCount, long cpuFeatures); |
| /** |
| * Force the sandboxed process to exit. |
| */ |
| - private static native void nativeExitSandboxedProcess(); |
| + private static native void nativeExitChildProcess(); |
| private native void nativeShutdownSandboxMainThread(); |
| } |