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 556a6167bf4589dfeb9d69b6985a0b2e972a22dc..ea3db5578f68fb274c4cac276b2bf78cc04046e0 100644 |
--- a/content/app/android/sandboxed_process_service.cc |
+++ b/content/app/android/sandboxed_process_service.cc |
@@ -8,6 +8,8 @@ |
#include "base/logging.h" |
#include "base/posix/global_descriptors.h" |
#include "content/common/android/surface_texture_peer.h" |
+#include "content/common/child_process.h" |
+#include "content/common/child_thread.h" |
#include "content/public/app/android_library_loader_hooks.h" |
#include "content/public/common/content_descriptors.h" |
#include "ipc/ipc_descriptors.h" |
@@ -71,6 +73,10 @@ void InternalInitSandboxedProcess(const std::vector<int>& file_ids, |
} |
+void QuitSandboxMainThreadMessageLoop() { |
+ MessageLoop::current()->Quit(); |
+} |
+ |
} // namespace <anonymous> |
namespace content { |
@@ -100,4 +106,14 @@ bool RegisterSandboxedProcessService(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |
+void ShutdownSandboxMainThread(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)); |
+} |
+ |
} // namespace content |