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

Unified Diff: content/browser/renderer_host/java/java_bridge_dispatcher_host.cc

Issue 8890018: Update Java Bridge to use its own thread in the browser process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
Index: content/browser/renderer_host/java/java_bridge_dispatcher_host.cc
diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc
index b923fc2c7ff8aeabae8ed0b7304951b7182bac8c..58c4a2a7a956e3460fe5bb2701e5e6fb4d8e74eb 100644
--- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc
+++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc
@@ -62,17 +62,11 @@ bool JavaBridgeDispatcherHost::OnMessageReceived(const IPC::Message& msg) {
}
void JavaBridgeDispatcherHost::OnGetChannelHandle(IPC::Message* reply_msg) {
- // In renderer-in-process mode, this sync IPC is coming from the WEBKIT
- // thread, so we can't post to the WEBKIT thread.
- if (RenderProcessHost::run_renderer_in_process()) {
- GetChannelHandle(reply_msg);
- } else {
- BrowserThread::PostTask(
- BrowserThread::WEBKIT,
- FROM_HERE,
- base::Bind(&JavaBridgeDispatcherHost::GetChannelHandle, this,
- reply_msg));
- }
+ BrowserThread::PostTask(
+ BrowserThread::JAVA_BRIDGE,
+ FROM_HERE,
+ base::Bind(&JavaBridgeDispatcherHost::GetChannelHandle, this,
+ reply_msg));
}
void JavaBridgeDispatcherHost::GetChannelHandle(IPC::Message* reply_msg) {
@@ -87,14 +81,14 @@ void JavaBridgeDispatcherHost::GetChannelHandle(IPC::Message* reply_msg) {
void JavaBridgeDispatcherHost::CreateNPVariantParam(NPObject* object,
NPVariant_Param* param) {
- // The JavaBridgeChannelHost needs to be created on the WEBKIT thread, as
+ // The JavaBridgeChannelHost needs to be created on the JAVA_BRIDGE thread, as
// that is where Java objects will live, and CreateNPVariantParam() needs the
// channel to create the NPObjectStub. To avoid blocking here until the
// channel is ready, create the NPVariant_Param by hand, then post a message
- // to the WEBKIT thread to set up the channel and create the corresponding
- // NPObjectStub. Post that message before doing any IPC, to make sure that
- // the channel and object proxies are ready before responses are received
- // from the renderer.
+ // to the JAVA_BRIDGE thread to set up the channel and create the
+ // corresponding NPObjectStub. Post that message before doing any IPC, to
+ // make sure that the channel and object proxies are ready before responses
+ // are received from the renderer.
// Create an NPVariantParam suitable for serialization over IPC from our
// NPVariant. See CreateNPVariantParam() in npobject_utils.
@@ -104,7 +98,7 @@ void JavaBridgeDispatcherHost::CreateNPVariantParam(NPObject* object,
WebKit::WebBindings::retainObject(object);
BrowserThread::PostTask(
- BrowserThread::WEBKIT,
+ BrowserThread::JAVA_BRIDGE,
FROM_HERE,
base::Bind(&JavaBridgeDispatcherHost::CreateObjectStub, this, object,
route_id));
@@ -112,7 +106,7 @@ void JavaBridgeDispatcherHost::CreateNPVariantParam(NPObject* object,
void JavaBridgeDispatcherHost::CreateObjectStub(NPObject* object,
int route_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::JAVA_BRIDGE));
if (!channel_) {
channel_ = JavaBridgeChannelHost::GetJavaBridgeChannelHost(

Powered by Google App Engine
This is Rietveld 408576698