summaryrefslogtreecommitdiffstats
path: root/content/app
diff options
context:
space:
mode:
authormichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 16:51:52 +0000
committermichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 16:51:52 +0000
commit25be53cbe8355aeac631053bfc8a0a99cfe4fc8d (patch)
tree1e236267e5bf6d6701ea8f952f7a2235ca905365 /content/app
parent7730542f90f8303ef276134f38b5d4dfc05d4d05 (diff)
downloadchromium_src-25be53cbe8355aeac631053bfc8a0a99cfe4fc8d.zip
chromium_src-25be53cbe8355aeac631053bfc8a0a99cfe4fc8d.tar.gz
chromium_src-25be53cbe8355aeac631053bfc8a0a99cfe4fc8d.tar.bz2
Fix the crash when the SandboxedProcessService is destroyed through onDestroy.
Didn't call nativeShutdownSandboxMainThread on Java service thread. BUG=163017 Review URL: https://chromiumcodereview.appspot.com/11428056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app')
-rw-r--r--content/app/android/sandboxed_process_service.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/content/app/android/sandboxed_process_service.cc b/content/app/android/sandboxed_process_service.cc
index 556a616..ea3db55 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