Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 1e0808c6cf2e4dd96051644d77b0044c23c6b02e..290cca61b0c248c2f1ec1ebc4ec7ab56930286b9 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -343,6 +343,11 @@ void BrowserMainLoop::RunMainMessageLoopParts( |
thread_to_start = &cache_thread_; |
options = &io_message_loop_options; |
break; |
+ case BrowserThread::JAVA_BRIDGE: |
+#if defined(ENABLE_JAVA_BRIDGE) |
+ thread_to_start = &java_bridge_thread_; |
+#endif |
+ break; |
case BrowserThread::IO: |
thread_to_start = &io_thread_; |
options = &io_message_loop_options; |
@@ -371,8 +376,6 @@ void BrowserMainLoop::RunMainMessageLoopParts( |
} else if (thread_to_start) { |
(*thread_to_start).reset(new BrowserProcessSubThread(id)); |
(*thread_to_start)->StartWithOptions(*options); |
- } else { |
- NOTREACHED(); |
} |
if (parts_.get()) |
@@ -429,6 +432,12 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { |
// |
// - (Not sure why the WEB_SOCKET_PROXY thread is stopped first.) |
// |
+ // - The JAVA_BRIDGE thread receives messages from the UI thread, and posts |
+ // messages to and receives messages from the IO thread. Of the |
+ // interactions with the IO thread, receiving messages is more common, so |
+ // make sure this thread outlives the IO thread to take advantage of the |
+ // optimization in BrowserThread. |
+ // |
// - The IO thread is the only user of the CACHE thread. |
// |
// - The PROCESS_LAUNCHER thread must be stopped after IO in case |
@@ -463,6 +472,11 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { |
case BrowserThread::CACHE: |
thread_to_stop = &cache_thread_; |
break; |
+ case BrowserThread::JAVA_BRIDGE: |
+#if defined(ENABLE_JAVA_BRIDGE) |
+ thread_to_stop = &java_bridge_thread_; |
+#endif |
+ break; |
case BrowserThread::IO: |
thread_to_stop = &io_thread_; |
break; |
@@ -487,8 +501,6 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { |
webkit_thread_.reset(); |
} else if (thread_to_stop) { |
thread_to_stop->reset(); |
- } else { |
- NOTREACHED(); |
} |
if (parts_.get()) |