summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--android_webview/Android.mk4
-rw-r--r--build/android/findbugs_filter/findbugs_known_bugs.txt7
-rw-r--r--content/app/android/app_jni_registrar.cc4
-rw-r--r--content/app/android/child_process_service.cc (renamed from content/app/android/sandboxed_process_service.cc)44
-rw-r--r--content/app/android/child_process_service.h (renamed from content/app/android/sandboxed_process_service.h)8
-rw-r--r--content/browser/android/browser_jni_registrar.cc4
-rw-r--r--content/browser/android/child_process_launcher.cc (renamed from content/browser/android/sandboxed_process_launcher.cc)40
-rw-r--r--content/browser/android/child_process_launcher.h37
-rw-r--r--content/browser/android/sandboxed_process_launcher.h39
-rw-r--r--content/browser/android/surface_texture_peer_browser_impl.h2
-rw-r--r--content/browser/child_process_launcher.cc10
-rw-r--r--content/content.gyp4
-rw-r--r--content/content_app.gypi4
-rw-r--r--content/content_browser.gypi4
-rw-r--r--content/content_jni.gypi4
-rw-r--r--content/public/android/java/src/org/chromium/content/app/ChildProcessService.java (renamed from content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java)133
-rw-r--r--content/public/android/java/src/org/chromium/content/app/ContentMain.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/app/SandboxedProcessService0.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/app/SandboxedProcessService1.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/app/SandboxedProcessService2.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/app/SandboxedProcessService3.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/app/SandboxedProcessService4.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/app/SandboxedProcessService5.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java4
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java (renamed from content/public/android/java/src/org/chromium/content/browser/SandboxedProcessConnection.java)199
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java (renamed from content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java)112
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java8
-rw-r--r--content/public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl (renamed from content/public/android/java/src/org/chromium/content/common/ISandboxedProcessCallback.aidl)2
-rw-r--r--content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl (renamed from content/public/android/java/src/org/chromium/content/common/ISandboxedProcessService.aidl)8
-rw-r--r--content/public/android/java/src/org/chromium/content/common/common.aidl8
-rw-r--r--content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java2
32 files changed, 359 insertions, 348 deletions
diff --git a/android_webview/Android.mk b/android_webview/Android.mk
index f2faabb..106081a 100644
--- a/android_webview/Android.mk
+++ b/android_webview/Android.mk
@@ -26,8 +26,8 @@ LOCAL_AIDL_INCLUDES := \
$(LOCAL_PATH)/../third_party/eyesfree/src/android/java/src
LOCAL_SRC_FILES += \
$(call all-java-files-under, ../content/public/android/java/src) \
- ../content/public/android/java/src/org/chromium/content/common/ISandboxedProcessCallback.aidl \
- ../content/public/android/java/src/org/chromium/content/common/ISandboxedProcessService.aidl \
+ ../content/public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl \
+ ../content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl \
$(call all-java-files-under, ../base/android/java/src) \
$(call all-java-files-under, ../media/base/android/java/src) \
$(call all-java-files-under, ../net/android/java/src) \
diff --git a/build/android/findbugs_filter/findbugs_known_bugs.txt b/build/android/findbugs_filter/findbugs_known_bugs.txt
index ae7d336..5adce22 100644
--- a/build/android/findbugs_filter/findbugs_known_bugs.txt
+++ b/build/android/findbugs_filter/findbugs_known_bugs.txt
@@ -1,5 +1,4 @@
H C EC: Using pointer equality to compare a JavaBridgeCoercionTest$CustomType with a JavaBridgeCoercionTest$CustomType2 in org.chromium.content.browser.JavaBridgeCoercionTest.testPassJavaObject() At JavaBridgeCoercionTest.java
-H D RCN: Redundant nullcheck of org.chromium.content.browser.SandboxedProcessConnection.mConnectionParams, which is known to be non-null in org.chromium.content.browser.SandboxedProcessConnection.doConnectionSetup() Redundant null check at SandboxedProcessConnection.java
M B DE: org.chromium.net.X509Util.clearTestRootCertificates() might ignore java.io.IOException At X509Util.java
M B Nm: The method name org.chromium.base.test.util.ScalableTimeout.ScaleTimeout(long) doesn't start with a lower case letter At ScalableTimeout.java
M B RV: exceptional return value of java.io.File.delete() ignored in org.chromium.android_webview.test.ArchiveTest.doArchiveTest(AwContents, String, boolean, String) At ArchiveTest.java
@@ -17,8 +16,6 @@ M C CSM: Shouldn't use synchronized method, please narrow down the synchronizati
M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At JavaBridgeReturnValuesTest.java
M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At JavaBridgeTestBase.java
M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At PerfTraceEvent.java
-M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At SandboxedProcessConnection.java
-M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At SandboxedProcessLauncher.java
M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At SimpleSynchronizedMethod.java
M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At SimpleSynchronizedStaticMethod.java
M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At TraceEvent.java
@@ -34,11 +31,7 @@ M D SF: Switch statement found in org.chromium.chrome.browser.database.SQLiteCur
M D SF: Switch statement found in org.chromium.content.browser.ContentSettings$EventHandler$1.handleMessage(Message) where default case is missing At ContentSettings.java
M D SF: Switch statement found in org.chromium.content.browser.HandleView.onTouchEvent(MotionEvent) where default case is missing At HandleView.java
M D SF: Switch statement found in org.chromium.content.browser.third_party.GestureDetector.onTouchEvent(MotionEvent) where default case is missing At GestureDetector.java
-M D ST: Write to static field org.chromium.content.app.SandboxedProcessService.sContext from instance method org.chromium.content.app.SandboxedProcessService.onCreate() At SandboxedProcessService.java
M D ST: Write to static field org.chromium.content.browser.ContentSettings.sAppCachePathIsSet from instance method org.chromium.content.browser.ContentSettings.setAppCachePath(String) At ContentSettings.java
-M M IS: Inconsistent synchronization of org.chromium.content.browser.SandboxedProcessConnection.mPID; locked 66% of time Unsynchronized access at SandboxedProcessConnection.java
-M M IS: Inconsistent synchronization of org.chromium.content.browser.SandboxedProcessConnection.mService; locked 55% of time Unsynchronized access at SandboxedProcessConnection.java
-M M IS: Inconsistent synchronization of org.chromium.content.browser.SandboxedProcessConnection.mServiceConnectComplete; locked 60% of time Unsynchronized access at SandboxedProcessConnection.java
M M LI: Incorrect lazy initialization and update of static field org.chromium.base.SystemMonitor.sInstance in org.chromium.base.SystemMonitor.create(Context) At SystemMonitor.java
M M LI: Incorrect lazy initialization and update of static field org.chromium.content.browser.ContentVideoView.sContentVideoView in org.chromium.content.browser.ContentVideoView.createContentVideoView(int) At ContentVideoView.java
M M UG: org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.getBooleanValue() is unsynchronized, org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.setBooleanValue(boolean) is synchronized At JavaBridgeReturnValuesTest.java
diff --git a/content/app/android/app_jni_registrar.cc b/content/app/android/app_jni_registrar.cc
index ee0863a..55585f2 100644
--- a/content/app/android/app_jni_registrar.cc
+++ b/content/app/android/app_jni_registrar.cc
@@ -6,14 +6,14 @@
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
+#include "content/app/android/child_process_service.h"
#include "content/app/android/content_main.h"
-#include "content/app/android/sandboxed_process_service.h"
namespace {
base::android::RegistrationMethod kContentRegisteredMethods[] = {
{ "ContentMain", content::RegisterContentMain },
- { "SandboxedProcessService", content::RegisterSandboxedProcessService },
+ { "ChildProcessService", content::RegisterChildProcessService },
};
} // namespace
diff --git a/content/app/android/sandboxed_process_service.cc b/content/app/android/child_process_service.cc
index 2f0d5bc..c0deb83 100644
--- a/content/app/android/sandboxed_process_service.cc
+++ b/content/app/android/child_process_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/app/android/sandboxed_process_service.h"
+#include "content/app/android/child_process_service.h"
#include <android/native_window_jni.h>
#include <cpu-features.h>
@@ -18,7 +18,7 @@
#include "content/public/app/android_library_loader_hooks.h"
#include "content/public/common/content_descriptors.h"
#include "ipc/ipc_descriptors.h"
-#include "jni/SandboxedProcessService_jni.h"
+#include "jni/ChildProcessService_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
@@ -28,18 +28,18 @@ namespace content {
namespace {
-class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer,
- public content::GpuSurfaceLookup {
+class SurfaceTexturePeerChildImpl : public content::SurfaceTexturePeer,
+ public content::GpuSurfaceLookup {
public:
// |service| is the instance of
- // org.chromium.content.app.SandboxedProcessService.
- explicit SurfaceTexturePeerSandboxedImpl(
+ // org.chromium.content.app.ChildProcessService.
+ explicit SurfaceTexturePeerChildImpl(
const base::android::ScopedJavaLocalRef<jobject>& service)
: service_(service) {
GpuSurfaceLookup::InitInstance(this);
}
- virtual ~SurfaceTexturePeerSandboxedImpl() {
+ virtual ~SurfaceTexturePeerChildImpl() {
GpuSurfaceLookup::InitInstance(NULL);
}
@@ -49,7 +49,7 @@ class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer,
int primary_id,
int secondary_id) {
JNIEnv* env = base::android::AttachCurrentThread();
- content::Java_SandboxedProcessService_establishSurfaceTexturePeer(
+ content::Java_ChildProcessService_establishSurfaceTexturePeer(
env, service_.obj(), pid,
surface_texture_bridge->j_surface_texture().obj(), primary_id,
secondary_id);
@@ -59,7 +59,7 @@ class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer,
virtual gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) OVERRIDE {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaSurface surface(
- content::Java_SandboxedProcessService_getViewSurface(
+ content::Java_ChildProcessService_getViewSurface(
env, service_.obj(), surface_id));
if (surface.j_surface().is_null())
@@ -72,15 +72,15 @@ class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer,
}
private:
- // The instance of org.chromium.content.app.SandboxedProcessService.
+ // The instance of org.chromium.content.app.ChildProcessService.
base::android::ScopedJavaGlobalRef<jobject> service_;
- DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerSandboxedImpl);
+ DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerChildImpl);
};
-// Chrome actually uses the renderer code path for all of its sandboxed
+// Chrome actually uses the renderer code path for all of its child
// processes such as renderers, plugins, etc.
-void InternalInitSandboxedProcess(const std::vector<int>& file_ids,
+void InternalInitChildProcess(const std::vector<int>& file_ids,
const std::vector<int>& file_fds,
JNIEnv* env,
jclass clazz,
@@ -100,17 +100,17 @@ void InternalInitSandboxedProcess(const std::vector<int>& file_ids,
base::GlobalDescriptors::GetInstance()->Set(file_ids[i], file_fds[i]);
content::SurfaceTexturePeer::InitInstance(
- new SurfaceTexturePeerSandboxedImpl(service));
+ new SurfaceTexturePeerChildImpl(service));
}
-void QuitSandboxMainThreadMessageLoop() {
+void QuitMainThreadMessageLoop() {
MessageLoop::current()->Quit();
}
} // namespace <anonymous>
-void InitSandboxedProcess(JNIEnv* env,
+void InitChildProcess(JNIEnv* env,
jclass clazz,
jobject context,
jobject service,
@@ -123,29 +123,29 @@ void InitSandboxedProcess(JNIEnv* env,
JavaIntArrayToIntVector(env, j_file_ids, &file_ids);
JavaIntArrayToIntVector(env, j_file_fds, &file_fds);
- InternalInitSandboxedProcess(
+ InternalInitChildProcess(
file_ids, file_fds, env, clazz, context, service,
cpu_count, cpu_features);
}
-void ExitSandboxedProcess(JNIEnv* env, jclass clazz) {
- LOG(INFO) << "SandboxedProcessService: Exiting sandboxed process.";
+void ExitChildProcess(JNIEnv* env, jclass clazz) {
+ LOG(INFO) << "ChildProcessService: Exiting child process.";
LibraryLoaderExitHook();
_exit(0);
}
-bool RegisterSandboxedProcessService(JNIEnv* env) {
+bool RegisterChildProcessService(JNIEnv* env) {
return RegisterNativesImpl(env);
}
-void ShutdownSandboxMainThread(JNIEnv* env, jobject obj) {
+void ShutdownMainThread(JNIEnv* env, jobject obj) {
ChildProcess* current_process = ChildProcess::current();
if (!current_process)
return;
ChildThread* main_child_thread = current_process->main_thread();
if (main_child_thread && main_child_thread->message_loop())
main_child_thread->message_loop()->PostTask(FROM_HERE,
- base::Bind(&QuitSandboxMainThreadMessageLoop));
+ base::Bind(&QuitMainThreadMessageLoop));
}
} // namespace content
diff --git a/content/app/android/sandboxed_process_service.h b/content/app/android/child_process_service.h
index 4ab991b..5ba4b8ae 100644
--- a/content/app/android/sandboxed_process_service.h
+++ b/content/app/android/child_process_service.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_APP_ANDROID_SANDBOXED_PROCESS_SERVICE_H_
-#define CONTENT_APP_ANDROID_SANDBOXED_PROCESS_SERVICE_H_
+#ifndef CONTENT_APP_ANDROID_CHILD_PROCESS_SERVICE_H_
+#define CONTENT_APP_ANDROID_CHILD_PROCESS_SERVICE_H_
#include <jni.h>
namespace content {
-bool RegisterSandboxedProcessService(JNIEnv* env);
+bool RegisterChildProcessService(JNIEnv* env);
} // namespace content
-#endif // CONTENT_APP_ANDROID_SANDBOXED_PROCESS_SERVICE_H_
+#endif // CONTENT_APP_ANDROID_CHILD_PROCESS_SERVICE_H_
diff --git a/content/browser/android/browser_jni_registrar.cc b/content/browser/android/browser_jni_registrar.cc
index e30394b..d15391b 100644
--- a/content/browser/android/browser_jni_registrar.cc
+++ b/content/browser/android/browser_jni_registrar.cc
@@ -7,6 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "content/browser/android/android_browser_process.h"
+#include "content/browser/android/child_process_launcher.h"
#include "content/browser/android/content_settings.h"
#include "content/browser/android/content_video_view.h"
#include "content/browser/android/content_view_core_impl.h"
@@ -16,7 +17,6 @@
#include "content/browser/android/download_controller_android_impl.h"
#include "content/browser/android/interstitial_page_delegate_android.h"
#include "content/browser/android/load_url_params.h"
-#include "content/browser/android/sandboxed_process_launcher.h"
#include "content/browser/android/surface_texture_peer_browser_impl.h"
#include "content/browser/android/touch_point.h"
#include "content/browser/android/tracing_intent_handler.h"
@@ -32,6 +32,7 @@ base::android::RegistrationMethod kContentRegisteredMethods[] = {
{ "AndroidLocationApiAdapter",
content::AndroidLocationApiAdapter::RegisterGeolocationService },
{ "AndroidBrowserProcess", content::RegisterAndroidBrowserProcess },
+ { "ChildProcessLauncher", content::RegisterChildProcessLauncher },
{ "ContentSettings", content::ContentSettings::RegisterContentSettings },
{ "ContentViewRenderView",
content::ContentViewRenderView::RegisterContentViewRenderView },
@@ -45,7 +46,6 @@ base::android::RegistrationMethod kContentRegisteredMethods[] = {
::RegisterInterstitialPageDelegateAndroid },
{ "LoadUrlParams", content::RegisterLoadUrlParams },
{ "RegisterImeAdapter", content::RegisterImeAdapter },
- { "SandboxedProcessLauncher", content::RegisterSandboxedProcessLauncher },
{ "TouchPoint", content::RegisterTouchPoint },
{ "TracingIntentHandler", content::RegisterTracingIntentHandler },
{ "WebContentsObserverAndroid", content::RegisterWebContentsObserverAndroid },
diff --git a/content/browser/android/sandboxed_process_launcher.cc b/content/browser/android/child_process_launcher.cc
index bd4d133..32feae6 100644
--- a/content/browser/android/sandboxed_process_launcher.cc
+++ b/content/browser/android/child_process_launcher.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/android/sandboxed_process_launcher.h"
+#include "content/browser/android/child_process_launcher.h"
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
@@ -14,14 +14,14 @@
#include "content/common/android/scoped_java_surface.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
-#include "jni/SandboxedProcessLauncher_jni.h"
+#include "jni/ChildProcessLauncher_jni.h"
#include "media/base/android/media_player_bridge.h"
using base::android::AttachCurrentThread;
using base::android::ToJavaArrayOfStrings;
using base::android::ScopedJavaGlobalRef;
using base::android::ScopedJavaLocalRef;
-using content::StartSandboxedProcessCallback;
+using content::StartChildProcessCallback;
namespace content {
@@ -61,27 +61,27 @@ static void SetSurfacePeer(
} // anonymous namespace
-// Called from SandboxedProcessLauncher.java when the SandboxedProcess was
+// Called from ChildProcessLauncher.java when the ChildProcess was
// started.
-// |client_context| is the pointer to StartSandboxedProcessCallback which was
-// passed in from StartSandboxedProcess.
+// |client_context| is the pointer to StartChildProcessCallback which was
+// passed in from StartChildProcess.
// |handle| is the processID of the child process as originated in Java, 0 if
-// the SandboxedProcess could not be created.
-static void OnSandboxedProcessStarted(JNIEnv*,
- jclass,
- jint client_context,
- jint handle) {
- StartSandboxedProcessCallback* callback =
- reinterpret_cast<StartSandboxedProcessCallback*>(client_context);
+// the ChildProcess could not be created.
+static void OnChildProcessStarted(JNIEnv*,
+ jclass,
+ jint client_context,
+ jint handle) {
+ StartChildProcessCallback* callback =
+ reinterpret_cast<StartChildProcessCallback*>(client_context);
if (handle)
callback->Run(static_cast<base::ProcessHandle>(handle));
delete callback;
}
-void StartSandboxedProcess(
+void StartChildProcess(
const CommandLine::StringVector& argv,
const std::vector<content::FileDescriptorInfo>& files_to_register,
- const StartSandboxedProcessCallback& callback) {
+ const StartChildProcessCallback& callback) {
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
@@ -115,19 +115,19 @@ void StartSandboxedProcess(
env->ReleaseIntArrayElements(j_file_fds.obj(), file_fds, 0);
env->ReleaseBooleanArrayElements(j_file_auto_close.obj(), file_auto_close, 0);
- Java_SandboxedProcessLauncher_start(env,
+ Java_ChildProcessLauncher_start(env,
base::android::GetApplicationContext(),
j_argv.obj(),
j_file_ids.obj(),
j_file_fds.obj(),
j_file_auto_close.obj(),
- reinterpret_cast<jint>(new StartSandboxedProcessCallback(callback)));
+ reinterpret_cast<jint>(new StartChildProcessCallback(callback)));
}
-void StopSandboxedProcess(base::ProcessHandle handle) {
+void StopChildProcess(base::ProcessHandle handle) {
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
- Java_SandboxedProcessLauncher_stop(env, static_cast<jint>(handle));
+ Java_ChildProcessLauncher_stop(env, static_cast<jint>(handle));
}
void EstablishSurfacePeer(
@@ -151,7 +151,7 @@ jobject GetViewSurface(JNIEnv* env, jclass clazz, jint surface_id) {
return CompositorImpl::GetSurface(surface_id);
}
-bool RegisterSandboxedProcessLauncher(JNIEnv* env) {
+bool RegisterChildProcessLauncher(JNIEnv* env) {
return RegisterNativesImpl(env);
}
diff --git a/content/browser/android/child_process_launcher.h b/content/browser/android/child_process_launcher.h
new file mode 100644
index 0000000..4b152c6
--- /dev/null
+++ b/content/browser/android/child_process_launcher.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_H_
+#define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_H_
+
+#include <jni.h>
+
+#include "base/callback.h"
+#include "base/command_line.h"
+#include "base/platform_file.h"
+#include "base/process.h"
+#include "content/public/browser/file_descriptor_info.h"
+
+namespace content {
+
+typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback;
+// Starts a process as a child process spawned by the Android
+// ActivityManager.
+// The created process handle is returned to the |callback| on success, 0 is
+// retuned if the process could not be created.
+void StartChildProcess(
+ const CommandLine::StringVector& argv,
+ const std::vector<FileDescriptorInfo>& files_to_register,
+ const StartChildProcessCallback& callback);
+
+// Stops a child process based on the handle returned form
+// StartChildProcess.
+void StopChildProcess(base::ProcessHandle handle);
+
+bool RegisterChildProcessLauncher(JNIEnv* env);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_H_
+
diff --git a/content/browser/android/sandboxed_process_launcher.h b/content/browser/android/sandboxed_process_launcher.h
deleted file mode 100644
index 64deaac..0000000
--- a/content/browser/android/sandboxed_process_launcher.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_
-#define CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_
-
-#include <jni.h>
-
-#include "base/callback.h"
-#include "base/command_line.h"
-#include "base/platform_file.h"
-#include "base/process.h"
-#include "content/public/browser/file_descriptor_info.h"
-
-namespace content {
-
-typedef base::Callback<void(base::ProcessHandle)> StartSandboxedProcessCallback;
-// Starts a process as a sandboxed process spawned by the Android
-// ActivityManager.
-// The created process handle is returned to the |callback| on success, 0 is
-// retuned if the process could not be created.
-void StartSandboxedProcess(
- const CommandLine::StringVector& argv,
- const std::vector<FileDescriptorInfo>& files_to_register,
- const StartSandboxedProcessCallback& callback);
-
-// Stops a sandboxed process based on the handle returned form
-// StartSandboxedProcess.
-void StopSandboxedProcess(base::ProcessHandle handle);
-
-// Registers JNI methods, this must be called before any other methods in this
-// file.
-bool RegisterSandboxedProcessLauncher(JNIEnv* env);
-
-} // namespace content
-
-#endif // CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_
-
diff --git a/content/browser/android/surface_texture_peer_browser_impl.h b/content/browser/android/surface_texture_peer_browser_impl.h
index 06c97bc..5ebe141 100644
--- a/content/browser/android/surface_texture_peer_browser_impl.h
+++ b/content/browser/android/surface_texture_peer_browser_impl.h
@@ -16,7 +16,7 @@ class SurfaceTexturePeerBrowserImpl : public SurfaceTexturePeer {
// Construct a SurfaceTexturePeerBrowserImpl object. If
// |player_in_render_process| is true, calling EstablishSurfaceTexturePeer()
// will send the java surface texture object to the render process through
- // SandboxedProcessService. Otherwise, it will pass the surface texture
+ // ChildProcessService. Otherwise, it will pass the surface texture
// to the MediaPlayerBridge object in the browser process.
SurfaceTexturePeerBrowserImpl();
virtual ~SurfaceTexturePeerBrowserImpl();
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 19be81a..20df18e 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -29,7 +29,7 @@
#include "content/browser/mach_broker_mac.h"
#elif defined(OS_ANDROID)
#include "base/android/jni_android.h"
-#include "content/browser/android/sandboxed_process_launcher.h"
+#include "content/browser/android/child_process_launcher.h"
#elif defined(OS_POSIX)
#include "base/memory/singleton.h"
#include "content/browser/renderer_host/render_sandbox_host_linux.h"
@@ -109,7 +109,7 @@ class ChildProcessLauncher::Context
}
#if defined(OS_ANDROID)
- static void OnSandboxedProcessStarted(
+ static void OnChildProcessStarted(
// |this_object| is NOT thread safe. Only use it to post a task back.
scoped_refptr<Context> this_object,
BrowserThread::ID client_thread_id,
@@ -210,8 +210,8 @@ class ChildProcessLauncher::Context
GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id,
&files_to_register);
- StartSandboxedProcess(cmd_line->argv(), files_to_register,
- base::Bind(&ChildProcessLauncher::Context::OnSandboxedProcessStarted,
+ StartChildProcess(cmd_line->argv(), files_to_register,
+ base::Bind(&ChildProcessLauncher::Context::OnChildProcessStarted,
this_object, client_thread_id, begin_launch_time));
#elif defined(OS_POSIX)
@@ -366,7 +366,7 @@ class ChildProcessLauncher::Context
base::ProcessHandle handle) {
#if defined(OS_ANDROID)
LOG(INFO) << "ChromeProcess: Stopping process with handle " << handle;
- StopSandboxedProcess(handle);
+ StopChildProcess(handle);
#else
base::Process process(handle);
// Client has gone away, so just kill the process. Using exit code 0
diff --git a/content/content.gyp b/content/content.gyp
index efaf48d..1068b7e 100644
--- a/content/content.gyp
+++ b/content/content.gyp
@@ -295,8 +295,8 @@
'aidl_interface_file': 'public/android/java/src/org/chromium/content/common/common.aidl',
},
'sources': [
- 'public/android/java/src/org/chromium/content/common/ISandboxedProcessCallback.aidl',
- 'public/android/java/src/org/chromium/content/common/ISandboxedProcessService.aidl',
+ 'public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl',
+ 'public/android/java/src/org/chromium/content/common/IChildProcessService.aidl',
],
'includes': [ '../build/java_aidl.gypi' ],
},
diff --git a/content/content_app.gypi b/content/content_app.gypi
index dc03208..2055f21 100644
--- a/content/content_app.gypi
+++ b/content/content_app.gypi
@@ -15,11 +15,11 @@
'sources': [
'app/android/app_jni_registrar.cc',
'app/android/app_jni_registrar.h',
+ 'app/android/child_process_service.cc',
+ 'app/android/child_process_service.h',
'app/android/content_main.cc',
'app/android/content_main.h',
'app/android/library_loader_hooks.cc',
- 'app/android/sandboxed_process_service.cc',
- 'app/android/sandboxed_process_service.h',
'app/content_main.cc',
'app/content_main_runner.cc',
'app/startup_helper_win.cc',
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index 225bcd3..c774ce3 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -214,6 +214,8 @@
'browser/android/android_browser_process.h',
'browser/android/browser_jni_registrar.cc',
'browser/android/browser_jni_registrar.h',
+ 'browser/android/child_process_launcher.cc',
+ 'browser/android/child_process_launcher.h',
'browser/android/content_settings.cc',
'browser/android/content_settings.h',
'browser/android/content_startup_flags.cc',
@@ -239,8 +241,6 @@
'browser/android/load_url_params.h',
'browser/android/media_player_manager_android.cc',
'browser/android/media_player_manager_android.h',
- 'browser/android/sandboxed_process_launcher.cc',
- 'browser/android/sandboxed_process_launcher.h',
'browser/android/surface_texture_peer_browser_impl.cc',
'browser/android/surface_texture_peer_browser_impl.h',
'browser/android/sync_input_event_filter.h',
diff --git a/content/content_jni.gypi b/content/content_jni.gypi
index cbe132a..784428a 100644
--- a/content/content_jni.gypi
+++ b/content/content_jni.gypi
@@ -8,10 +8,11 @@
# TODO(jrg): when doing the above, make sure we support multiple
# output directories (e.g. browser/jni and common/jni if needed).
'sources': [
+ 'public/android/java/src/org/chromium/content/app/ChildProcessService.java',
'public/android/java/src/org/chromium/content/app/ContentMain.java',
'public/android/java/src/org/chromium/content/app/LibraryLoader.java',
- 'public/android/java/src/org/chromium/content/app/SandboxedProcessService.java',
'public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java',
+ 'public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java',
'public/android/java/src/org/chromium/content/browser/ContentSettings.java',
'public/android/java/src/org/chromium/content/browser/ContentVideoView.java',
'public/android/java/src/org/chromium/content/browser/ContentViewCore.java',
@@ -24,7 +25,6 @@
'public/android/java/src/org/chromium/content/browser/InterstitialPageDelegateAndroid.java',
'public/android/java/src/org/chromium/content/browser/LoadUrlParams.java',
'public/android/java/src/org/chromium/content/browser/LocationProvider.java',
- 'public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java',
'public/android/java/src/org/chromium/content/browser/TouchPoint.java',
'public/android/java/src/org/chromium/content/browser/TracingIntentHandler.java',
'public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.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
index 2c5bd60..4729bb7 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
@@ -18,33 +18,34 @@ import android.view.Surface;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
-import org.chromium.content.browser.SandboxedProcessConnection;
-import org.chromium.content.common.ISandboxedProcessCallback;
-import org.chromium.content.common.ISandboxedProcessService;
-import org.chromium.content.browser.SandboxedProcessLauncher;
+import org.chromium.content.browser.ChildProcessConnection;
+import org.chromium.content.common.IChildProcessCallback;
+import org.chromium.content.common.IChildProcessService;
+import org.chromium.content.browser.ChildProcessLauncher;
import org.chromium.content.common.ProcessInitException;
import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicReference;
/**
- * This is the base class for sandboxed services; the SandboxedProcessService0, 1.. etc
+ * This is the base class for child services; the [Non]SandboxedProcessService0, 1.. etc
* subclasses provide the concrete service entry points, to enable the browser to connect
* to more than one distinct process (i.e. one process per service number, up to limit of N).
* The embedding application must declare these service instances in the application section
* of its AndroidManifest.xml, for example with N entries of the form:-
- * <service android:name="org.chromium.content.app.SandboxedProcessServiceX"
- * android:process=":sandboxed_processX" />
- * for X in 0...N-1 (where N is {@link SandboxedProcessLauncher#MAX_REGISTERED_SERVICES})
+ * <service android:name="org.chromium.content.app.[Non]SandboxedProcessServiceX"
+ * android:process=":[non]sandboxed_processX" />
+ * 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;
- // Parameters received via IPC, only accessed while holding the mSandboxMainThread monitor.
+ private Thread mMainThread;
+ // Parameters received via IPC, only accessed while holding the mMainThread monitor.
private String mNativeLibraryName; // Must be passed in via the bind command.
private String[] mCommandLineParams;
private int mCpuCount;
@@ -53,88 +54,88 @@ public class SandboxedProcessService extends Service {
private ArrayList<Integer> mFileIds;
private ArrayList<ParcelFileDescriptor> mFileFds;
- private static Context sContext = null;
+ private static AtomicReference<Context> sContext = new AtomicReference<Context>(null);
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) {
+ synchronized (mMainThread) {
// 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();
+ mMainThread.notifyAll();
}
return Process.myPid();
}
};
/* package */ static Context getContext() {
- return sContext;
+ return sContext.get();
}
@Override
public void onCreate() {
- Log.i(TAG, "Creating new SandboxedProcessService pid=" + Process.myPid());
- if (sContext != null) {
- Log.e(TAG, "SanboxedProcessService created again in process!");
+ Log.i(TAG, "Creating new ChildProcessService pid=" + Process.myPid());
+ if (sContext.get() != null) {
+ Log.e(TAG, "ChildProcessService created again in process!");
}
- sContext = this;
+ sContext.set(this);
super.onCreate();
- mSandboxMainThread = new Thread(new Runnable() {
+ mMainThread = new Thread(new Runnable() {
@Override
public void run() {
try {
- synchronized (mSandboxMainThread) {
+ synchronized (mMainThread) {
while (mNativeLibraryName == null) {
- mSandboxMainThread.wait();
+ mMainThread.wait();
}
}
LibraryLoader.setLibraryToLoad(mNativeLibraryName);
try {
LibraryLoader.loadNow();
} catch (ProcessInitException e) {
- Log.e(TAG, "Failed to load native library, exiting sandboxed process", e);
+ Log.e(TAG, "Failed to load native library, exiting child process", e);
return;
}
- synchronized (mSandboxMainThread) {
+ synchronized (mMainThread) {
while (mCommandLineParams == null) {
- mSandboxMainThread.wait();
+ mMainThread.wait();
}
}
LibraryLoader.initializeOnMainThread(mCommandLineParams);
- synchronized (mSandboxMainThread) {
+ synchronized (mMainThread) {
mLibraryInitialized = true;
- mSandboxMainThread.notifyAll();
+ mMainThread.notifyAll();
while (mFileIds == null) {
- mSandboxMainThread.wait();
+ mMainThread.wait();
}
}
assert mFileIds.size() == mFileFds.size();
@@ -144,12 +145,12 @@ public class SandboxedProcessService extends Service {
fileIds[i] = mFileIds.get(i);
fileFds[i] = mFileFds.get(i).detachFd();
}
- ContentMain.initApplicationContext(sContext.getApplicationContext());
- nativeInitSandboxedProcess(sContext.getApplicationContext(),
- SandboxedProcessService.this, fileIds, fileFds,
+ ContentMain.initApplicationContext(sContext.get().getApplicationContext());
+ nativeInitChildProcess(sContext.get().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) {
@@ -157,46 +158,46 @@ public class SandboxedProcessService extends Service {
}
}
}, MAIN_THREAD_NAME);
- mSandboxMainThread.start();
+ mMainThread.start();
}
@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.
return;
}
- synchronized (mSandboxMainThread) {
+ synchronized (mMainThread) {
try {
while (!mLibraryInitialized) {
// Avoid a potential race in calling through to native code before the library
// has loaded.
- mSandboxMainThread.wait();
+ mMainThread.wait();
}
} catch (InterruptedException e) {
}
}
- // Try to shutdown the SandboxMainThread gracefully, but it might not
+ // Try to shutdown the MainThread gracefully, but it might not
// have chance to exit normally.
- nativeShutdownSandboxMainThread();
+ nativeShutdownMainThread();
}
@Override
public IBinder onBind(Intent intent) {
// We call stopSelf() to request that this service be stopped as soon as the client
// unbinds. Otherwise the system may keep it around and available for a reconnect. The
- // sandboxed processes do not currently support reconnect; they must be initialized from
+ // child processes do not currently support reconnect; they must be initialized from
// scratch every time.
stopSelf();
- synchronized (mSandboxMainThread) {
+ synchronized (mMainThread) {
mNativeLibraryName = intent.getStringExtra(
- SandboxedProcessConnection.EXTRA_NATIVE_LIBRARY_NAME);
+ ChildProcessConnection.EXTRA_NATIVE_LIBRARY_NAME);
mCommandLineParams = intent.getStringArrayExtra(
- SandboxedProcessConnection.EXTRA_COMMAND_LINE);
- mSandboxMainThread.notifyAll();
+ ChildProcessConnection.EXTRA_COMMAND_LINE);
+ mMainThread.notifyAll();
}
return mBinder;
@@ -207,8 +208,8 @@ public class SandboxedProcessService extends Service {
* Through using the callback object the browser is used as a proxy to route the
* call to the correct process.
*
- * @param pid Process handle of the sandboxed process to share the SurfaceTexture with.
- * @param surfaceObject The Surface or SurfaceTexture to share with the other sandboxed process.
+ * @param pid Process handle of the child process to share the SurfaceTexture with.
+ * @param surfaceObject The Surface or SurfaceTexture to share with the other child process.
* @param primaryID Used to route the call to the correct client instance.
* @param secondaryID Used to route the call to the correct client instance.
*/
@@ -261,23 +262,23 @@ public class SandboxedProcessService extends Service {
}
/**
- * The main entry point for a sandboxed process. This should be called from a new thread since
- * it will not return until the sandboxed process exits. See sandboxed_process_service.{h,cc}
+ * The main entry point for a child process. This should be called from a new thread since
+ * it will not return until the child process exits. See child_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.
+ * Force the child process to exit.
*/
- private static native void nativeExitSandboxedProcess();
+ private static native void nativeExitChildProcess();
- private native void nativeShutdownSandboxMainThread();
+ private native void nativeShutdownMainThread();
}
diff --git a/content/public/android/java/src/org/chromium/content/app/ContentMain.java b/content/public/android/java/src/org/chromium/content/app/ContentMain.java
index 4ff24ec..09ba783 100644
--- a/content/public/android/java/src/org/chromium/content/app/ContentMain.java
+++ b/content/public/android/java/src/org/chromium/content/app/ContentMain.java
@@ -14,7 +14,7 @@ import org.chromium.base.JNINamespace;
* the different initialization process.
*
* TODO (michaelbai): Refactorying the BrowserProcessMain.java and the
- * SandboxedProcessService.java to start ContentMain, and run the process
+ * ChildProcessService.java to start ContentMain, and run the process
* specific initialization code in ContentMainRunner::Initialize.
*
**/
diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService0.java b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService0.java
index 1fcd974..0b54bc4 100644
--- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService0.java
+++ b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService0.java
@@ -7,6 +7,6 @@ package org.chromium.content.app;
// This is needed to register multiple SandboxedProcess services so that we can have
// more than one sandboxed process.
-public class SandboxedProcessService0 extends SandboxedProcessService {
+public class SandboxedProcessService0 extends ChildProcessService {
}
diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService1.java b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService1.java
index 24846a7..ec275e5 100644
--- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService1.java
+++ b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService1.java
@@ -7,6 +7,6 @@ package org.chromium.content.app;
// This is needed to register multiple SandboxedProcess services so that we can have
// more than one sandboxed process.
-public class SandboxedProcessService1 extends SandboxedProcessService {
+public class SandboxedProcessService1 extends ChildProcessService {
}
diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService2.java b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService2.java
index f8d1802..cc47337 100644
--- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService2.java
+++ b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService2.java
@@ -7,6 +7,6 @@ package org.chromium.content.app;
// This is needed to register multiple SandboxedProcess services so that we can have
// more than one sandboxed process.
-public class SandboxedProcessService2 extends SandboxedProcessService {
+public class SandboxedProcessService2 extends ChildProcessService {
}
diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService3.java b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService3.java
index f5b8fa5..207232c 100644
--- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService3.java
+++ b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService3.java
@@ -7,6 +7,6 @@ package org.chromium.content.app;
// This is needed to register multiple SandboxedProcess services so that we can have
// more than one sandboxed process.
-public class SandboxedProcessService3 extends SandboxedProcessService {
+public class SandboxedProcessService3 extends ChildProcessService {
}
diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService4.java b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService4.java
index bec8dea..3cf919c 100644
--- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService4.java
+++ b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService4.java
@@ -7,6 +7,6 @@ package org.chromium.content.app;
// This is needed to register multiple SandboxedProcess services so that we can have
// more than one sandboxed process.
-public class SandboxedProcessService4 extends SandboxedProcessService {
+public class SandboxedProcessService4 extends ChildProcessService {
}
diff --git a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService5.java b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService5.java
index 9a852e1..88a18ff 100644
--- a/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService5.java
+++ b/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService5.java
@@ -7,6 +7,6 @@ package org.chromium.content.app;
// This is needed to register multiple SandboxedProcess services so that we can have
// more than one sandboxed process.
-public class SandboxedProcessService5 extends SandboxedProcessService {
+public class SandboxedProcessService5 extends ChildProcessService {
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java b/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
index 2e26342..cead46a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
+++ b/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
@@ -50,12 +50,12 @@ public class AndroidBrowserProcess {
// Cap on the maximum number of renderer processes that can be requested.
// This is currently set to account for:
- // 6: The maximum number of sandboxed processes we have available
+ // 6: The maximum number of child processes we have available
// - 1: The regular New Tab Page
// - 1: The incognito New Tab Page
// - 1: A regular incognito tab
public static final int MAX_RENDERERS_LIMIT =
- SandboxedProcessLauncher.MAX_REGISTERED_SERVICES - 3;
+ ChildProcessLauncher.MAX_REGISTERED_SERVICES - 3;
/**
* Initialize the process as a ContentView host. This must be called from the main UI thread.
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
index c28a3c4..66012c5 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
@@ -22,62 +22,63 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.chromium.base.CalledByNative;
import org.chromium.base.CpuFeatures;
import org.chromium.base.ThreadUtils;
-import org.chromium.content.app.SandboxedProcessService;
+import org.chromium.content.app.ChildProcessService;
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.
public static final String EXTRA_COMMAND_LINE =
- "com.google.android.apps.chrome.extra.sandbox_command_line";
+ "com.google.android.apps.chrome.extra.command_line";
public static final String EXTRA_NATIVE_LIBRARY_NAME =
- "com.google.android.apps.chrome.extra.sandbox_native_library_name";
+ "com.google.android.apps.chrome.extra.native_library_name";
// Note the FDs may only be passed in the connection bundle.
public static final String EXTRA_FILES_PREFIX =
- "com.google.android.apps.chrome.extra.sandbox_extraFile_";
+ "com.google.android.apps.chrome.extra.extraFile_";
public static final String EXTRA_FILES_ID_SUFFIX = "_id";
public static final String EXTRA_FILES_FD_SUFFIX = "_fd";
- // Used to pass the CPU core count to sandboxed processes.
+ // Used to pass the CPU core count to child processes.
public static final String EXTRA_CPU_COUNT =
"com.google.android.apps.chrome.extra.cpu_count";
- // Used to pass the CPU features mask to sandboxed processes.
+ // Used to pass the CPU features mask to child processes.
public static final String EXTRA_CPU_FEATURES =
"com.google.android.apps.chrome.extra.cpu_features";
private final Context mContext;
private final int mServiceNumber;
- private final SandboxedProcessConnection.DeathCallback mDeathCallback;
- private final Class<? extends SandboxedProcessService> mServiceClass;
+ private final ChildProcessConnection.DeathCallback mDeathCallback;
+ private final Class<? extends ChildProcessService> mServiceClass;
// 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 final Object mUiThreadLock = new Object();
+ private IChildProcessService mService = null;
private boolean mServiceConnectComplete = false;
- private int mPID = 0; // Process ID of the corresponding sandboxed process.
+ private int mPID = 0; // Process ID of the corresponding child 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;
@@ -90,9 +91,9 @@ public class SandboxedProcessConnection implements ServiceConnection {
private ConnectionParams mConnectionParams;
private boolean mIsBound;
- SandboxedProcessConnection(Context context, int number,
- SandboxedProcessConnection.DeathCallback deathCallback,
- Class<? extends SandboxedProcessService> serviceClass) {
+ ChildProcessConnection(Context context, int number,
+ ChildProcessConnection.DeathCallback deathCallback,
+ Class<? extends ChildProcessService> serviceClass) {
mContext = context;
mServiceNumber = number;
mDeathCallback = deathCallback;
@@ -103,43 +104,48 @@ public class SandboxedProcessConnection implements ServiceConnection {
return mServiceNumber;
}
- synchronized ISandboxedProcessService getService() {
- return mService;
+ IChildProcessService getService() {
+ synchronized(mUiThreadLock) {
+ return mService;
+ }
}
private Intent createServiceBindIntent() {
Intent intent = new Intent();
- intent.setClassName(mContext, mServiceClass.getName() + mServiceNumber);
+ String serviceClassNameBase = mServiceClass.getName().replaceAll("[0-9]*$", "");
+ intent.setClassName(mContext, serviceClassNameBase + 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).
* @param nativeLibraryName The name of the shared native library to be loaded for the
- * sandboxed process.
- * @param commandLine (Optional) Command line for the sandboxed process. If omitted, then
+ * child process.
+ * @param commandLine (Optional) Command line for the child process. If omitted, then
* the command line parameters must instead be passed to setupConnection().
*/
- synchronized void bind(String nativeLibraryName, String[] commandLine) {
- TraceEvent.begin();
- assert !ThreadUtils.runningOnUiThread();
+ void bind(String nativeLibraryName, String[] commandLine) {
+ synchronized(mUiThreadLock) {
+ TraceEvent.begin();
+ assert !ThreadUtils.runningOnUiThread();
- final Intent intent = createServiceBindIntent();
+ final Intent intent = createServiceBindIntent();
- intent.putExtra(EXTRA_NATIVE_LIBRARY_NAME, nativeLibraryName);
- if (commandLine != null) {
- intent.putExtra(EXTRA_COMMAND_LINE, commandLine);
- }
+ intent.putExtra(EXTRA_NATIVE_LIBRARY_NAME, nativeLibraryName);
+ if (commandLine != null) {
+ intent.putExtra(EXTRA_COMMAND_LINE, commandLine);
+ }
- mIsBound = mContext.bindService(intent, this, Context.BIND_AUTO_CREATE);
- if (!mIsBound) {
- onBindFailed();
+ mIsBound = mContext.bindService(intent, this, Context.BIND_AUTO_CREATE);
+ if (!mIsBound) {
+ onBindFailed();
+ }
+ TraceEvent.end();
}
- TraceEvent.end();
}
/** Setup a connection previous bound via a call to bind().
@@ -150,50 +156,56 @@ public class SandboxedProcessConnection implements ServiceConnection {
* @param callback Used for status updates regarding this process connection.
* @param onConnectionCallback will be run when the connection is setup and ready to use.
*/
- synchronized void setupConnection(
+ void setupConnection(
String[] commandLine,
FileDescriptorInfo[] filesToBeMapped,
- ISandboxedProcessCallback callback,
+ IChildProcessCallback callback,
Runnable onConnectionCallback) {
- TraceEvent.begin();
- assert mConnectionParams == null;
- mConnectionParams = new ConnectionParams(commandLine, filesToBeMapped, callback,
- onConnectionCallback);
- if (mServiceConnectComplete) {
- doConnectionSetup();
+ synchronized(mUiThreadLock) {
+ TraceEvent.begin();
+ assert mConnectionParams == null;
+ mConnectionParams = new ConnectionParams(commandLine, filesToBeMapped, callback,
+ onConnectionCallback);
+ if (mServiceConnectComplete) {
+ doConnectionSetup();
+ }
+ TraceEvent.end();
}
- TraceEvent.end();
}
/**
- * 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) {
- mContext.unbindService(this);
- mIsBound = false;
- }
- if (mService != null) {
- if (mHighPriorityConnection != null) {
- unbindHighPriority(true);
+ void unbind() {
+ synchronized(mUiThreadLock) {
+ if (mIsBound) {
+ mContext.unbindService(this);
+ mIsBound = false;
+ }
+ if (mService != null) {
+ if (mHighPriorityConnection != null) {
+ unbindHighPriority(true);
+ }
+ mService = null;
+ mPID = 0;
}
- mService = null;
- mPID = 0;
+ mConnectionParams = null;
+ mServiceConnectComplete = false;
}
- mConnectionParams = null;
- mServiceConnectComplete = false;
}
// Called on the main thread to notify that the service is connected.
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
- TraceEvent.begin();
- mServiceConnectComplete = true;
- mService = ISandboxedProcessService.Stub.asInterface(service);
- if (mConnectionParams != null) {
- doConnectionSetup();
+ synchronized(mUiThreadLock) {
+ TraceEvent.begin();
+ mServiceConnectComplete = true;
+ mService = IChildProcessService.Stub.asInterface(service);
+ if (mConnectionParams != null) {
+ doConnectionSetup();
+ }
+ TraceEvent.end();
}
- TraceEvent.end();
}
// Called on the main thread to notify that the bindService() call failed (returned false).
@@ -212,8 +224,7 @@ public class SandboxedProcessConnection implements ServiceConnection {
TraceEvent.begin();
assert mServiceConnectComplete && mConnectionParams != null;
// Capture the callback before it is potentially nulled in unbind().
- Runnable onConnectionCallback =
- mConnectionParams != null ? mConnectionParams.mOnConnectionCallback : null;
+ Runnable onConnectionCallback = mConnectionParams.mOnConnectionCallback;
if (onConnectionCallback == null) {
unbind();
} else if (mService != null) {
@@ -273,7 +284,7 @@ public class SandboxedProcessConnection implements ServiceConnection {
TraceEvent.end();
}
- // Called on the main thread to notify that the sandboxed service did not disconnect gracefully.
+ // Called on the main thread to notify that the child service did not disconnect gracefully.
@Override
public void onServiceDisconnected(ComponentName className) {
int pid = mPID; // Stash pid & connection callback since unbind() will clear them.
@@ -282,7 +293,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();
@@ -293,30 +304,34 @@ public class SandboxedProcessConnection implements ServiceConnection {
* Bind the service with a new high priority connection. This will make the service
* as important as the main process.
*/
- synchronized void bindHighPriority() {
- if (mService == null) {
- Log.w(TAG, "The connection is not bound for " + mPID);
- return;
- }
- if (mHighPriorityConnection == null) {
- mHighPriorityConnection = new HighPriorityConnection();
- mHighPriorityConnection.bind();
+ void bindHighPriority() {
+ synchronized(mUiThreadLock) {
+ if (mService == null) {
+ Log.w(TAG, "The connection is not bound for " + mPID);
+ return;
+ }
+ if (mHighPriorityConnection == null) {
+ mHighPriorityConnection = new HighPriorityConnection();
+ mHighPriorityConnection.bind();
+ }
+ mHighPriorityConnectionCount++;
}
- mHighPriorityConnectionCount++;
}
/**
* Unbind the service as the high priority connection.
*/
- synchronized void unbindHighPriority(boolean force) {
- if (mService == null) {
- Log.w(TAG, "The connection is not bound for " + mPID);
- return;
- }
- mHighPriorityConnectionCount--;
- if (force || (mHighPriorityConnectionCount == 0 && mHighPriorityConnection != null)) {
- mHighPriorityConnection.unbind();
- mHighPriorityConnection = null;
+ void unbindHighPriority(boolean force) {
+ synchronized(mUiThreadLock) {
+ if (mService == null) {
+ Log.w(TAG, "The connection is not bound for " + mPID);
+ return;
+ }
+ mHighPriorityConnectionCount--;
+ if (force || (mHighPriorityConnectionCount == 0 && mHighPriorityConnection != null)) {
+ mHighPriorityConnection.unbind();
+ mHighPriorityConnection = null;
+ }
}
}
@@ -350,7 +365,9 @@ public class SandboxedProcessConnection implements ServiceConnection {
/**
* @return The connection PID, or 0 if not yet connected.
*/
- synchronized public int getPid() {
- return mPID;
+ public int getPid() {
+ synchronized(mUiThreadLock) {
+ return mPID;
+ }
}
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
index 057609f..e59a7e8 100644
--- a/content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -17,18 +17,18 @@ import java.util.concurrent.ConcurrentHashMap;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
+import org.chromium.content.app.ChildProcessService;
import org.chromium.content.app.LibraryLoader;
-import org.chromium.content.app.SandboxedProcessService;
-import org.chromium.content.common.ISandboxedProcessCallback;
-import org.chromium.content.common.ISandboxedProcessService;
+import org.chromium.content.common.IChildProcessCallback;
+import org.chromium.content.common.IChildProcessService;
/**
- * This class provides the method to start/stop SandboxedProcess called by
+ * This class provides the method to start/stop ChildProcess called by
* native.
*/
@JNINamespace("content")
-public class SandboxedProcessLauncher {
- private static String TAG = "SandboxedProcessLauncher";
+public class ChildProcessLauncher {
+ private static String TAG = "ChildProcessLauncher";
private static final int CALLBACK_FOR_UNKNOWN_PROCESS = 0;
private static final int CALLBACK_FOR_GPU_PROCESS = 1;
@@ -37,10 +37,10 @@ public class SandboxedProcessLauncher {
// The upper limit on the number of simultaneous service process instances supported.
// This must not exceed total number of SandboxedProcessServiceX classes declared in
// this package, and defined as services in the embedding application's manifest file.
- // (See {@link SandboxedProcessService} for more details on defining the services.)
+ // (See {@link ChildProcessService} for more details on defining the services.)
/* package */ static final int MAX_REGISTERED_SERVICES = 6;
- private static final SandboxedProcessConnection[] mConnections =
- new SandboxedProcessConnection[MAX_REGISTERED_SERVICES];
+ private static final ChildProcessConnection[] mConnections =
+ new ChildProcessConnection[MAX_REGISTERED_SERVICES];
// The list of free slots in mConnections. When looking for a free connection,
// the first index in that list should be used. When a connection is freed, its index
// is added to the end of the list. This is so that we avoid immediately reusing a freed
@@ -57,54 +57,54 @@ public class SandboxedProcessLauncher {
}
}
- // Service class for sandboxed process. As the default value it uses
- // SandboxedProcessService.
- private static Class<? extends SandboxedProcessService> mServiceClass =
- SandboxedProcessService.class;
+ // Service class for child process. As the default value it uses
+ // SandboxedProcessService0.
+ private static Class<? extends ChildProcessService> mServiceClass =
+ org.chromium.content.app.SandboxedProcessService0.class;
private static boolean mConnectionAllocated = false;
// Sets service class for sandboxed service.
- public static void setServiceClass(Class<? extends SandboxedProcessService> serviceClass) {
+ public static void setServiceClass(Class<? extends ChildProcessService> serviceClass) {
// We should guarantee this is called before allocating connection.
assert !mConnectionAllocated;
mServiceClass = serviceClass;
}
- private static SandboxedProcessConnection allocateConnection(Context context) {
- SandboxedProcessConnection.DeathCallback deathCallback =
- new SandboxedProcessConnection.DeathCallback() {
+ private static ChildProcessConnection allocateConnection(Context context) {
+ ChildProcessConnection.DeathCallback deathCallback =
+ new ChildProcessConnection.DeathCallback() {
@Override
- public void onSandboxedProcessDied(int pid) {
+ public void onChildProcessDied(int pid) {
stop(pid);
}
};
synchronized (mConnections) {
if (mFreeConnectionIndices.isEmpty()) {
- Log.w(TAG, "Ran out of sandboxed services.");
+ Log.w(TAG, "Ran out of child services.");
return null;
}
int slot = mFreeConnectionIndices.remove(0);
assert mConnections[slot] == null;
- mConnections[slot] = new SandboxedProcessConnection(context, slot, deathCallback,
+ mConnections[slot] = new ChildProcessConnection(context, slot, deathCallback,
mServiceClass);
mConnectionAllocated = true;
return mConnections[slot];
}
}
- private static SandboxedProcessConnection allocateBoundConnection(Context context,
+ private static ChildProcessConnection allocateBoundConnection(Context context,
String[] commandLine) {
- SandboxedProcessConnection connection = allocateConnection(context);
+ ChildProcessConnection connection = allocateConnection(context);
if (connection != null) {
String libraryName = LibraryLoader.getLibraryToLoad();
- assert libraryName != null : "Attempting to launch a sandbox process without first "
+ assert libraryName != null : "Attempting to launch a child process without first "
+ "calling LibraryLoader.setLibraryToLoad";
connection.bind(libraryName, commandLine);
}
return connection;
}
- private static void freeConnection(SandboxedProcessConnection connection) {
+ private static void freeConnection(ChildProcessConnection connection) {
if (connection == null) {
return;
}
@@ -133,23 +133,23 @@ public class SandboxedProcessLauncher {
// Represents an invalid process handle; same as base/process.h kNullProcessHandle.
private static final int NULL_PROCESS_HANDLE = 0;
- // Map from pid to SandboxedService connection.
- private static Map<Integer, SandboxedProcessConnection> mServiceMap =
- new ConcurrentHashMap<Integer, SandboxedProcessConnection>();
+ // Map from pid to ChildService connection.
+ private static Map<Integer, ChildProcessConnection> mServiceMap =
+ new ConcurrentHashMap<Integer, ChildProcessConnection>();
// A pre-allocated and pre-bound connection ready for connection setup, or null.
- static SandboxedProcessConnection mSpareConnection = null;
+ static ChildProcessConnection mSpareConnection = null;
/**
- * Returns the sandboxed process service interface for the given pid. This may be called on
+ * Returns the child process service interface for the given pid. This may be called on
* any thread, but the caller must assume that the service can disconnect at any time. All
* service calls should catch and handle android.os.RemoteException.
*
* @param pid The pid (process handle) of the service obtained from {@link #start}.
- * @return The ISandboxedProcessService or null if the service no longer exists.
+ * @return The IChildProcessService or null if the service no longer exists.
*/
- public static ISandboxedProcessService getSandboxedService(int pid) {
- SandboxedProcessConnection connection = mServiceMap.get(pid);
+ public static IChildProcessService getChildService(int pid) {
+ ChildProcessConnection connection = mServiceMap.get(pid);
if (connection != null) {
return connection.getService();
}
@@ -157,25 +157,27 @@ public class SandboxedProcessLauncher {
}
/**
- * Should be called early in startup so the work needed to spawn the sandboxed process can
+ * Should be called early in startup so the work needed to spawn the child process can
* be done in parallel to other startup work. Must not be called on the UI thread.
* @param context the application context used for the connection.
*/
- public static synchronized void warmUp(Context context) {
- assert !ThreadUtils.runningOnUiThread();
- if (mSpareConnection == null) {
- mSpareConnection = allocateBoundConnection(context, null);
+ public static void warmUp(Context context) {
+ synchronized (ChildProcessLauncher.class) {
+ assert !ThreadUtils.runningOnUiThread();
+ if (mSpareConnection == null) {
+ mSpareConnection = allocateBoundConnection(context, null);
+ }
}
}
/**
- * Spawns and connects to a sandboxed process. May be called on any thread. It will not
- * block, but will instead callback to {@link #nativeOnSandboxedProcessStarted} when the
+ * Spawns and connects to a child process. May be called on any thread. It will not
+ * block, but will instead callback to {@link #nativeOnChildProcessStarted} when the
* connection is established. Note this callback will not necessarily be from the same thread
* (currently it always comes from the main thread).
*
* @param context Context used to obtain the application context.
- * @param commandLine The sandboxed process command line argv.
+ * @param commandLine The child process command line argv.
* @param file_ids The ID that should be used when mapping files in the created process.
* @param file_fds The file descriptors that should be mapped in the created process.
* @param file_auto_close Whether the file descriptors should be closed once they were passed to
@@ -197,8 +199,8 @@ public class SandboxedProcessLauncher {
new FileDescriptorInfo(fileIds[i], fileFds[i], fileAutoClose[i]);
}
assert clientContext != 0;
- SandboxedProcessConnection allocatedConnection;
- synchronized (SandboxedProcessLauncher.class) {
+ ChildProcessConnection allocatedConnection;
+ synchronized (ChildProcessLauncher.class) {
allocatedConnection = mSpareConnection;
mSpareConnection = null;
}
@@ -206,13 +208,13 @@ public class SandboxedProcessLauncher {
allocatedConnection = allocateBoundConnection(context, commandLine);
if (allocatedConnection == null) {
// Notify the native code so it can free the heap allocated callback.
- nativeOnSandboxedProcessStarted(clientContext, 0);
+ nativeOnChildProcessStarted(clientContext, 0);
return;
}
}
- final SandboxedProcessConnection connection = allocatedConnection;
+ final ChildProcessConnection connection = allocatedConnection;
Log.d(TAG, "Setting up connection to process: slot=" + connection.getServiceNumber());
- // Note: This runnable will be executed when the sandboxed connection is setup.
+ // Note: This runnable will be executed when the child connection is setup.
final Runnable onConnect = new Runnable() {
@Override
public void run() {
@@ -223,7 +225,7 @@ public class SandboxedProcessLauncher {
} else {
freeConnection(connection);
}
- nativeOnSandboxedProcessStarted(clientContext, pid);
+ nativeOnChildProcessStarted(clientContext, pid);
}
};
int callbackType = CALLBACK_FOR_UNKNOWN_PROCESS;
@@ -241,15 +243,15 @@ public class SandboxedProcessLauncher {
}
/**
- * Terminates a sandboxed process. This may be called from any thread.
+ * Terminates a child process. This may be called from any thread.
*
* @param pid The pid (process handle) of the service connection obtained from {@link #start}.
*/
@CalledByNative
static void stop(int pid) {
- Log.d(TAG, "stopping sandboxed connection: pid=" + pid);
+ Log.d(TAG, "stopping child connection: pid=" + pid);
- SandboxedProcessConnection connection = mServiceMap.remove(pid);
+ ChildProcessConnection connection = mServiceMap.remove(pid);
if (connection == null) {
Log.w(TAG, "Tried to stop non-existent connection to pid: " + pid);
return;
@@ -259,14 +261,14 @@ public class SandboxedProcessLauncher {
}
/**
- * Bind a sandboxed process as a high priority process so that it has the same
+ * Bind a child process as a high priority process so that it has the same
* priority as the main process. This can be used for the foreground renderer
* process to distinguish it from the the background renderer process.
*
* @param pid The process handle of the service connection obtained from {@link #start}.
*/
static void bindAsHighPriority(int pid) {
- SandboxedProcessConnection connection = mServiceMap.get(pid);
+ ChildProcessConnection connection = mServiceMap.get(pid);
if (connection == null) {
Log.w(TAG, "Tried to bind a non-existent connection to pid: " + pid);
return;
@@ -280,7 +282,7 @@ public class SandboxedProcessLauncher {
* @param pid The process handle of the service obtained from {@link #start}.
*/
static void unbindAsHighPriority(int pid) {
- SandboxedProcessConnection connection = mServiceMap.get(pid);
+ ChildProcessConnection connection = mServiceMap.get(pid);
if (connection == null) {
Log.w(TAG, "Tried to unbind non-existent connection to pid: " + pid);
return;
@@ -291,8 +293,8 @@ public class SandboxedProcessLauncher {
/**
* This implementation is used to receive callbacks from the remote service.
*/
- private static ISandboxedProcessCallback createCallback(final int callbackType) {
- return new ISandboxedProcessCallback.Stub() {
+ private static IChildProcessCallback createCallback(final int callbackType) {
+ return new IChildProcessCallback.Stub() {
/**
* This is called by the remote service regularly to tell us about
* new values. Note that IPC calls are dispatched through a thread
@@ -326,7 +328,7 @@ public class SandboxedProcessLauncher {
};
};
- private static native void nativeOnSandboxedProcessStarted(int clientContext, int pid);
+ private static native void nativeOnChildProcessStarted(int clientContext, int pid);
private static native Surface nativeGetViewSurface(int surfaceId);
private static native void nativeEstablishSurfacePeer(
int pid, Surface surface, int primaryID, int secondaryID);
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java b/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java
index acf624d..e14bf04 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java
@@ -32,7 +32,7 @@ import java.lang.ref.WeakReference;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
-import org.chromium.content.common.ISandboxedProcessService;
+import org.chromium.content.common.IChildProcessService;
import org.chromium.content.R;
@JNINamespace("content")
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 6691f64..25520c6 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -1180,7 +1180,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
if (mNativeContentViewCore != 0) {
int pid = nativeGetCurrentRenderProcessId(mNativeContentViewCore);
if (pid > 0) {
- SandboxedProcessLauncher.bindAsHighPriority(pid);
+ ChildProcessLauncher.bindAsHighPriority(pid);
}
}
setAccessibilityState(true);
@@ -1195,7 +1195,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
if (mNativeContentViewCore != 0) {
int pid = nativeGetCurrentRenderProcessId(mNativeContentViewCore);
if (pid > 0) {
- SandboxedProcessLauncher.unbindAsHighPriority(pid);
+ ChildProcessLauncher.unbindAsHighPriority(pid);
}
}
setAccessibilityState(false);
@@ -2133,10 +2133,10 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
private void onRenderProcessSwap(int oldPid, int newPid) {
if (mAttachedToWindow && oldPid != newPid) {
if (oldPid > 0) {
- SandboxedProcessLauncher.unbindAsHighPriority(oldPid);
+ ChildProcessLauncher.unbindAsHighPriority(oldPid);
}
if (newPid > 0) {
- SandboxedProcessLauncher.bindAsHighPriority(newPid);
+ ChildProcessLauncher.bindAsHighPriority(newPid);
}
}
}
diff --git a/content/public/android/java/src/org/chromium/content/common/ISandboxedProcessCallback.aidl b/content/public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl
index b315fa9..734c05e 100644
--- a/content/public/android/java/src/org/chromium/content/common/ISandboxedProcessCallback.aidl
+++ b/content/public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl
@@ -6,7 +6,7 @@ package org.chromium.content.common;
import android.view.Surface;
-interface ISandboxedProcessCallback {
+interface IChildProcessCallback {
// Conduit to pass a Surface from the sandboxed renderer to the plugin.
void establishSurfacePeer(
diff --git a/content/public/android/java/src/org/chromium/content/common/ISandboxedProcessService.aidl b/content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl
index 3d7be3c..0b6c09a 100644
--- a/content/public/android/java/src/org/chromium/content/common/ISandboxedProcessService.aidl
+++ b/content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl
@@ -4,12 +4,12 @@
package org.chromium.content.common;
-import org.chromium.content.common.ISandboxedProcessCallback;
+import org.chromium.content.common.IChildProcessCallback;
import android.view.Surface;
import android.os.Bundle;
-interface ISandboxedProcessService {
- // Sets up the initial IPC channel and returns the pid of the sandboxed process.
- int setupConnection(in Bundle args, ISandboxedProcessCallback callback);
+interface IChildProcessService {
+ // Sets up the initial IPC channel and returns the pid of the child process.
+ int setupConnection(in Bundle args, IChildProcessCallback callback);
}
diff --git a/content/public/android/java/src/org/chromium/content/common/common.aidl b/content/public/android/java/src/org/chromium/content/common/common.aidl
index 96ebb7e..565ae3a 100644
--- a/content/public/android/java/src/org/chromium/content/common/common.aidl
+++ b/content/public/android/java/src/org/chromium/content/common/common.aidl
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file is needed to compile ISandBoxedProcessCallback.aidl and
-// ISandboxedProcessServices.aidl into java source files. See
+// This file is needed to compile IChildProcessCallback.aidl and
+// IChildProcessServices.aidl into java source files. See
// content/public/android/java/content.xml for target aidl.
-interface org.chromium.content.common.ISandboxedProcessCallback;
-interface org.chromium.content.common.ISandboxedProcessService;
+interface org.chromium.content.common.IChildProcessCallback;
+interface org.chromium.content.common.IChildProcessService;
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java
index d070fb0..6d79070 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java
@@ -12,7 +12,7 @@ import org.chromium.content.browser.ResourceExtractor;
/**
* Entry point for the content shell application. Handles initialization of information that needs
- * to be shared across the main activity and the sandbox services created.
+ * to be shared across the main activity and the child services created.
*/
public class ContentShellApplication extends Application {