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

Unified Diff: content/app/android/sandboxed_process_service.cc

Issue 10696025: Upstream ChildProcessLauncher changes for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add additional assert and comments Created 8 years, 6 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
« no previous file with comments | « base/android/jni_array.cc ('k') | content/browser/android/sandboxed_process_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/android/sandboxed_process_service.cc
diff --git a/content/app/android/sandboxed_process_service.cc b/content/app/android/sandboxed_process_service.cc
index 7c87d71dd0c1e12d8130640c9d4f6df19bb79a33..58a2687bda81b5d0d7cb93558b5fd7e4df2d63ab 100644
--- a/content/app/android/sandboxed_process_service.cc
+++ b/content/app/android/sandboxed_process_service.cc
@@ -4,6 +4,7 @@
#include "content/app/android/sandboxed_process_service.h"
+#include "base/android/jni_array.h"
#include "base/global_descriptors_posix.h"
#include "base/logging.h"
#include "content/common/android/surface_texture_peer.h"
@@ -14,6 +15,7 @@
using base::android::AttachCurrentThread;
using base::android::CheckException;
+using base::android::JavaIntArrayToIntVector;
namespace {
@@ -35,7 +37,7 @@ class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer {
int secondary_id) {
JNIEnv* env = base::android::AttachCurrentThread();
content::Java_SandboxedProcessService_establishSurfaceTexturePeer(
- env, service_, pid, type, j_surface_texture, primary_id, secondary_id);
+ env, service_, pid, type, j_surface_texture, primary_id, secondary_id);
CheckException(env);
}
@@ -49,18 +51,22 @@ class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer {
// Chrome actually uses the renderer code path for all of its sandboxed
// processes such as renderers, plugins, etc.
void InternalInitSandboxedProcess(int ipc_fd,
- int crash_fd,
+ const std::vector<int>& extra_file_ids,
+ const std::vector<int>& extra_file_fds,
JNIEnv* env,
jclass clazz,
jobject context,
jobject service) {
// Set up the IPC file descriptor mapping.
base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel, ipc_fd);
-#if defined(USE_LINUX_BREAKPAD)
- if (crash_fd > 0) {
- base::GlobalDescriptors::GetInstance()->Set(kCrashDumpSignal, crash_fd);
+ // Register the extra file descriptors.
+ // This usually include the crash dump signals and resource related files.
+ DCHECK(extra_file_fds.size() == extra_file_ids.size());
+ for (size_t i = 0; i < extra_file_ids.size(); ++i) {
+ base::GlobalDescriptors::GetInstance()->Set(extra_file_ids[i],
+ extra_file_fds[i]);
}
-#endif
+
content::SurfaceTexturePeer::InitInstance(
new SurfaceTexturePeerSandboxedImpl(service));
@@ -75,13 +81,16 @@ void InitSandboxedProcess(JNIEnv* env,
jobject context,
jobject service,
jint ipc_fd,
- jint crash_fd) {
- InternalInitSandboxedProcess(static_cast<int>(ipc_fd),
- static_cast<int>(crash_fd), env, clazz, context, service);
+ jintArray j_extra_file_ids,
+ jintArray j_extra_file_fds) {
+ std::vector<int> extra_file_ids;
+ std::vector<int> extra_file_fds;
+ JavaIntArrayToIntVector(env, j_extra_file_ids, &extra_file_ids);
+ JavaIntArrayToIntVector(env, j_extra_file_fds, &extra_file_fds);
- // sandboxed process can't be reused. There is no need to wait for the browser
- // to unbind the service. Just exit and done.
- LOG(INFO) << "SandboxedProcessService: Drop out of SandboxedProcessMain.";
+ InternalInitSandboxedProcess(static_cast<int>(ipc_fd),
+ extra_file_ids, extra_file_fds,
+ env, clazz, context, service);
}
void ExitSandboxedProcess(JNIEnv* env, jclass clazz) {
« no previous file with comments | « base/android/jni_array.cc ('k') | content/browser/android/sandboxed_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698