Chromium Code Reviews| Index: android_webview/browser/aw_message_port_message_filter.cc |
| diff --git a/android_webview/browser/aw_message_port_message_filter.cc b/android_webview/browser/aw_message_port_message_filter.cc |
| index fc2d314496c1c7d716376d85f5f9cccca3657a79..b19b344651421d93db02ca35035e7ec5a3532d64 100644 |
| --- a/android_webview/browser/aw_message_port_message_filter.cc |
| +++ b/android_webview/browser/aw_message_port_message_filter.cc |
| @@ -7,6 +7,7 @@ |
| #include "android_webview/browser/aw_browser_context.h" |
| #include "android_webview/common/aw_message_port_messages.h" |
| #include "content/public/browser/message_port_provider.h" |
| +#include "content/public/common/message_port_types.h" |
| using content::BrowserThread; |
| using content::MessagePortProvider; |
| @@ -46,7 +47,10 @@ void AwMessagePortMessageFilter::OnConvertedAppToWebMessage( |
| const base::string16& message, |
| const std::vector<int>& sent_message_port_ids) { |
| - MessagePortProvider::PostMessageToPort(msg_port_id, message, |
| + // TODO(mek): Bypass the extra roundtrip and just send the unconverted message |
| + // to the renderer directly. |
|
sgurun-gerrit only
2015/02/27 03:17:36
I don't know what you ended up designing for conve
Marijn Kruisselbrink
2015/02/27 05:00:57
Well, messages send from the browser to a MessageP
sgurun-gerrit only
2015/02/27 18:06:50
ok I just wanted to understand what overall soluti
Marijn Kruisselbrink
2015/02/27 18:17:51
Yes, it would be nice to be kept in the loop on an
sgurun-gerrit only
2015/02/27 18:33:25
my comment is wrt to the webview that you mentione
|
| + MessagePortProvider::PostMessageToPort(msg_port_id, |
| + content::MessagePortMessage(message), |
| sent_message_port_ids); |
| } |
| @@ -76,12 +80,13 @@ void AwMessagePortMessageFilter::SendClosePortMessage(int message_port_id) { |
| void AwMessagePortMessageFilter::SendMessage( |
| int msg_port_route_id, |
| - const base::string16& message, |
| + const content::MessagePortMessage& message, |
| const std::vector<int>& sent_message_port_ids) { |
| + DCHECK(message.is_string()); |
| Send(new AwMessagePortMsg_WebToAppMessage( |
| route_id_, |
| msg_port_route_id, // same as the port id |
| - message, sent_message_port_ids)); |
| + message.message_as_string, sent_message_port_ids)); |
| } |
| void AwMessagePortMessageFilter::SendMessagesAreQueued(int route_id) { |