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

Unified Diff: android_webview/browser/aw_message_port_message_filter.cc

Issue 1974613002: Remove code that was only used by navigator.connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 7 months 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
« no previous file with comments | « android_webview/browser/aw_message_port_message_filter.h ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0232b33b9d00898121aeaf66e6f3a8fbfaadc165..e577dd48eea937a2529a31937ce5f9070b755416 100644
--- a/android_webview/browser/aw_message_port_message_filter.cc
+++ b/android_webview/browser/aw_message_port_message_filter.cc
@@ -7,7 +7,6 @@
#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,15 +45,9 @@ void AwMessagePortMessageFilter::OnConvertedAppToWebMessage(
int msg_port_id,
const base::string16& message,
const std::vector<int>& sent_message_port_ids) {
- std::vector<content::TransferredMessagePort>
- sent_ports(sent_message_port_ids.size());
- for (size_t i = 0; i < sent_message_port_ids.size(); ++i)
- sent_ports[i].id = sent_message_port_ids[i];
- // TODO(mek): Bypass the extra roundtrip and just send the unconverted message
- // to the renderer directly.
MessagePortProvider::PostMessageToPort(msg_port_id,
- content::MessagePortMessage(message),
- sent_ports);
+ message,
+ sent_message_port_ids);
}
void AwMessagePortMessageFilter::OnClosePortAck(int message_port_id) {
@@ -83,21 +76,16 @@ void AwMessagePortMessageFilter::SendClosePortMessage(int message_port_id) {
void AwMessagePortMessageFilter::SendMessage(
int msg_port_route_id,
- const content::MessagePortMessage& message,
- const std::vector<content::TransferredMessagePort>& sent_message_ports) {
- DCHECK(message.is_string());
- std::vector<int> sent_message_port_ids(sent_message_ports.size());
- for (size_t i = 0; i < sent_message_ports.size(); ++i) {
- DCHECK(!sent_message_ports[i].send_messages_as_values);
- int sent_port_id = sent_message_ports[i].id;
+ const base::string16& message,
+ const std::vector<int>& sent_message_port_ids) {
+ for (int sent_port_id : sent_message_port_ids) {
MessagePortProvider::HoldMessages(sent_port_id);
MessagePortProvider::UpdateMessagePort(sent_port_id, this);
- sent_message_port_ids[i] = sent_port_id;
}
Send(new AwMessagePortMsg_WebToAppMessage(
route_id_,
msg_port_route_id, // same as the port id
- message.message_as_string, sent_message_port_ids));
+ message, sent_message_port_ids));
}
void AwMessagePortMessageFilter::SendMessagesAreQueued(int route_id) {
« no previous file with comments | « android_webview/browser/aw_message_port_message_filter.h ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698