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

Unified Diff: content/browser/navigator_connect/navigator_connect_context_impl.cc

Issue 938403005: Make it possible for a navigator.connect service to receive messages as base::Value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-message-as-values-pass-flag
Patch Set: mention bug Created 5 years, 10 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
Index: content/browser/navigator_connect/navigator_connect_context_impl.cc
diff --git a/content/browser/navigator_connect/navigator_connect_context_impl.cc b/content/browser/navigator_connect/navigator_connect_context_impl.cc
index 35a02d1029aac29b11bf3bb8a9fc7939dc9305a4..c5f01f4534a60e52c622eb4c0d66f266a645ae4c 100644
--- a/content/browser/navigator_connect/navigator_connect_context_impl.cc
+++ b/content/browser/navigator_connect/navigator_connect_context_impl.cc
@@ -68,8 +68,8 @@ void NavigatorConnectContextImpl::Connect(
if (!factory) {
// No factories found.
- OnConnectResult(client, client_port, client_port_route_id,
- callback, nullptr);
+ OnConnectResult(client, client_port, client_port_route_id, callback,
+ nullptr, false);
return;
}
@@ -84,7 +84,8 @@ void NavigatorConnectContextImpl::OnConnectResult(
int client_message_port_id,
int client_port_route_id,
const ConnectCallback& callback,
- MessagePortDelegate* delegate) {
+ MessagePortDelegate* delegate,
+ bool data_as_values) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (delegate) {
// Update service side port with delegate.
@@ -92,7 +93,7 @@ void NavigatorConnectContextImpl::OnConnectResult(
client.message_port_id, delegate, client.message_port_id);
TransferredMessagePort port;
port.id = client_message_port_id;
- // TODO(mek): Set port.send_value_as_messages depending on connect result.
+ port.send_messages_as_values = data_as_values;
callback.Run(port, client_port_route_id, true);
} else {
// Destroy ports since connection failed.

Powered by Google App Engine
This is Rietveld 408576698