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

Unified Diff: content/child/webmessageportchannel_impl.h

Issue 944443003: Step two of optionally sending messages to/from message ports as base::Value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-message-as-values-take2
Patch Set: use auto where it makes sense 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 cb87aff67a35d7a233492a3d6e3b8c2ee8c7e02d..4b9c273d01dcac2267d685d82950aceaa1d85364 100644
--- a/content/child/webmessageportchannel_impl.h
+++ b/content/child/webmessageportchannel_impl.h
@@ -36,7 +36,7 @@ class WebMessagePortChannelImpl
main_thread_task_runner);
WebMessagePortChannelImpl(
int route_id,
- int message_port_id,
+ const TransferredMessagePort& port,
const scoped_refptr<base::SingleThreadTaskRunner>&
main_thread_task_runner);
@@ -48,9 +48,22 @@ class WebMessagePortChannelImpl
// Extracts port IDs for passing on to the browser process, and queues any
// received messages. Takes ownership of the passed array (and deletes it).
- static std::vector<int> ExtractMessagePortIDs(
+ static std::vector<TransferredMessagePort> ExtractMessagePortIDs(
blink::WebMessagePortChannelArray* channels);
+ // Extracts port IDs for passing on to the browser process, and queues any
+ // received messages.
+ static std::vector<TransferredMessagePort> ExtractMessagePortIDs(
+ const blink::WebMessagePortChannelArray& channels);
+
+ // Creates WebMessagePortChannelImpl instances for port IDs passed in from the
+ // browser process.
+ static blink::WebMessagePortChannelArray CreatePorts(
+ const std::vector<TransferredMessagePort>& message_ports,
+ const std::vector<int>& new_routing_ids,
+ const scoped_refptr<base::SingleThreadTaskRunner>&
+ main_thread_task_runner);
+
// Queues received and incoming messages until there are no more in-flight
// messages, then sends all of them to the browser process.
void QueueMessages();
@@ -78,7 +91,7 @@ class WebMessagePortChannelImpl
bool OnMessageReceived(const IPC::Message& message) override;
void OnMessage(const MessagePortMessage& message,
- const std::vector<int>& sent_message_port_ids,
+ const std::vector<TransferredMessagePort>& sent_message_ports,
const std::vector<int>& new_routing_ids);
void OnMessagesQueued();
@@ -87,7 +100,7 @@ class WebMessagePortChannelImpl
~Message();
MessagePortMessage message;
- std::vector<WebMessagePortChannelImpl*> ports;
+ blink::WebMessagePortChannelArray ports;
};
typedef std::queue<Message> MessageQueue;
« no previous file with comments | « content/child/service_worker/service_worker_dispatcher.cc ('k') | content/child/webmessageportchannel_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698