| Index: chrome/browser/extensions/api/messaging/message_service.cc
|
| diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
|
| index ae8a50400378706c7baf41aad681e7cc17dd83ef..6f6ec088b67507fbcff4f46bd47a8911b47d972c 100644
|
| --- a/chrome/browser/extensions/api/messaging/message_service.cc
|
| +++ b/chrome/browser/extensions/api/messaging/message_service.cc
|
| @@ -187,9 +187,7 @@ void MessageService::OpenChannelToNativeApp(
|
| int source_routing_id,
|
| int receiver_port_id,
|
| const std::string& source_extension_id,
|
| - const std::string& native_app_name,
|
| - const std::string& channel_name,
|
| - const std::string& connect_message) {
|
| + const std::string& native_app_name) {
|
| content::RenderProcessHost* source =
|
| content::RenderProcessHost::FromID(source_process_id);
|
| if (!source)
|
| @@ -210,34 +208,12 @@ void MessageService::OpenChannelToNativeApp(
|
| channel->opener.reset(new ExtensionMessagePort(source, MSG_ROUTING_CONTROL,
|
| source_extension_id));
|
|
|
| - NativeMessageProcessHost::MessageType type =
|
| - channel_name == "chrome.runtime.sendNativeMessage" ?
|
| - NativeMessageProcessHost::TYPE_SEND_MESSAGE_REQUEST :
|
| - NativeMessageProcessHost::TYPE_CONNECT;
|
| -
|
| - content::BrowserThread::PostTask(
|
| - content::BrowserThread::FILE,
|
| - FROM_HERE,
|
| - base::Bind(&NativeMessageProcessHost::Create,
|
| - base::WeakPtr<NativeMessageProcessHost::Client>(
|
| - weak_factory_.GetWeakPtr()),
|
| - native_app_name, connect_message, receiver_port_id,
|
| - type,
|
| - base::Bind(&MessageService::FinalizeOpenChannelToNativeApp,
|
| - weak_factory_.GetWeakPtr(),
|
| - receiver_port_id,
|
| - channel_name,
|
| - base::Passed(&channel),
|
| - tab_json)));
|
| -}
|
|
|
| -void MessageService::FinalizeOpenChannelToNativeApp(
|
| - int receiver_port_id,
|
| - const std::string& channel_name,
|
| - scoped_ptr<MessageChannel> channel,
|
| - const std::string& tab_json,
|
| - NativeMessageProcessHost::ScopedHost native_process) {
|
| - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
| + scoped_ptr<NativeMessageProcessHost> native_process =
|
| + NativeMessageProcessHost::Create(
|
| + base::WeakPtr<NativeMessageProcessHost::Client>(
|
| + weak_factory_.GetWeakPtr()),
|
| + native_app_name, receiver_port_id);
|
|
|
| // Abandon the channel
|
| if (!native_process.get()) {
|
|
|