diff options
author | mek <mek@chromium.org> | 2015-02-27 11:12:39 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-27 19:13:47 +0000 |
commit | 09ac29ceebbed0fa9a4500ee6e78acb13ebf9eaa (patch) | |
tree | 75a205dbd731ea3fbe2201ee4399a40ca134f563 /content/browser/message_port_service.h | |
parent | db08b352a58642711d27058f5f4f2cd2f9a148d1 (diff) | |
download | chromium_src-09ac29ceebbed0fa9a4500ee6e78acb13ebf9eaa.zip chromium_src-09ac29ceebbed0fa9a4500ee6e78acb13ebf9eaa.tar.gz chromium_src-09ac29ceebbed0fa9a4500ee6e78acb13ebf9eaa.tar.bz2 |
Optionally have MessagePort pass data as base::Value, part 1.
Various efforts (android webview, navigator.connect) are experimenting
with using MessagePort as a way to communicate with native code. This is
a start at refactoring MessagePort code to make this possible.
This CL changes the IPCs for MessagePort messages to pass the data as
a MessagePortMessage struct, adding support to the renderer side
MessagePort code to support both base::Value and blink::WebSerializedScriptValue
messages. Additionally a (currently unset) flag is added that determines
how MessagePort sends messages back to the browser process.
This is part of a series of changes:
[1/5] Blink side changes in https://codereview.chromium.org/924983002/ that expose a needed v8 context
[2/5] This CL
[3/5] https://codereview.chromium.org/944443003/ which causes the send_messages_as_values flag to be propagated
[4/5] https://codereview.chromium.org/938403005/ which uses this for navigator.connect services and adds infrastructure for layout tests
[5/5] https://codereview.chromium.org/940423004/ adds layout tests to blink to test these new features
BUG=426458
Review URL: https://codereview.chromium.org/921013002
Cr-Commit-Position: refs/heads/master@{#318492}
Diffstat (limited to 'content/browser/message_port_service.h')
-rw-r--r-- | content/browser/message_port_service.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/content/browser/message_port_service.h b/content/browser/message_port_service.h index 5623e94..1e561b2 100644 --- a/content/browser/message_port_service.h +++ b/content/browser/message_port_service.h @@ -13,6 +13,7 @@ #include "base/memory/singleton.h" #include "base/strings/string16.h" #include "content/common/content_export.h" +#include "content/public/common/message_port_types.h" #include "ipc/ipc_message.h" namespace content { @@ -20,7 +21,7 @@ class MessagePortDelegate; class CONTENT_EXPORT MessagePortService { public: - typedef std::vector<std::pair<base::string16, std::vector<int> > > + typedef std::vector<std::pair<content::MessagePortMessage, std::vector<int>>> QueuedMessages; // Returns the MessagePortService singleton. @@ -33,7 +34,7 @@ class CONTENT_EXPORT MessagePortService { void Destroy(int message_port_id); void Entangle(int local_message_port_id, int remote_message_port_id); void PostMessage(int sender_message_port_id, - const base::string16& message, + const MessagePortMessage& message, const std::vector<int>& sent_message_port_ids); void QueueMessages(int message_port_id); void SendQueuedMessages(int message_port_id, @@ -72,7 +73,7 @@ class CONTENT_EXPORT MessagePortService { ~MessagePortService(); void PostMessageTo(int message_port_id, - const base::string16& message, + const MessagePortMessage& message, const std::vector<int>& sent_message_port_ids); // Handles the details of removing a message port id. Before calling this, |