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

Unified Diff: content/child/webmessageportchannel_impl.h

Issue 921013002: Optionally have MessagePort pass data as base::Value, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-move-v8-value-converter
Patch Set: Update singly-included comment 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/child/webmessageportchannel_impl.h
diff --git a/content/child/webmessageportchannel_impl.h b/content/child/webmessageportchannel_impl.h
index f3e6714431ef9f45ee9c5ebaa1accb681d84a57f..cb87aff67a35d7a233492a3d6e3b8c2ee8c7e02d 100644
--- a/content/child/webmessageportchannel_impl.h
+++ b/content/child/webmessageportchannel_impl.h
@@ -10,13 +10,16 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
+#include "content/public/common/message_port_types.h"
#include "ipc/ipc_listener.h"
#include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
namespace base {
class SingleThreadTaskRunner;
+class Value;
}
namespace content {
@@ -68,13 +71,13 @@ class WebMessagePortChannelImpl
void Init();
void Entangle(scoped_refptr<WebMessagePortChannelImpl> channel);
void Send(IPC::Message* message);
- void PostMessage(const base::string16& message,
+ void PostMessage(const MessagePortMessage& message,
blink::WebMessagePortChannelArray* channels);
// IPC::Listener implementation.
bool OnMessageReceived(const IPC::Message& message) override;
- void OnMessage(const base::string16& message,
+ void OnMessage(const MessagePortMessage& message,
const std::vector<int>& sent_message_port_ids,
const std::vector<int>& new_routing_ids);
void OnMessagesQueued();
@@ -83,7 +86,7 @@ class WebMessagePortChannelImpl
Message();
~Message();
- base::string16 message;
+ MessagePortMessage message;
std::vector<WebMessagePortChannelImpl*> ports;
};
@@ -95,6 +98,10 @@ class WebMessagePortChannelImpl
int route_id_; // The routing id for this object.
int message_port_id_; // A globally unique identifier for this message port.
+ // Flag to indicate if messages should be sent to the browser process as
+ // base::Value instances as opposed to being serialized using the default
+ // blink::WebSerializedScriptValue.
+ bool send_messages_as_values_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl);
« no previous file with comments | « content/child/navigator_connect/navigator_connect_provider.cc ('k') | content/child/webmessageportchannel_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698