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

Unified Diff: content/browser/message_port_message_filter.h

Issue 668303004: WIP DO NOT COMMIT chromium side of navigator.connect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 | « no previous file | content/browser/message_port_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/message_port_message_filter.h
diff --git a/content/browser/message_port_message_filter.h b/content/browser/message_port_message_filter.h
index 21bfbb24e17add0058050f49227148fe266d23c6..364c5ed99f47b2ad066e819058d35000b1ad5dce 100644
--- a/content/browser/message_port_message_filter.h
+++ b/content/browser/message_port_message_filter.h
@@ -11,9 +11,21 @@
namespace content {
+class MessagePortHandler {
+ public:
+ virtual void SendMessage(int route_id,
+ const base::string16& message,
+ const std::vector<int>& sent_message_port_ids) = 0;
+ virtual void SendMessagesQueued(int route_id) = 0;
+
+ protected:
+ virtual ~MessagePortHandler() {}
+};
+
// Filter for MessagePort related IPC messages (creating and destroying a
// MessagePort, sending a message via a MessagePort etc).
-class CONTENT_EXPORT MessagePortMessageFilter : public BrowserMessageFilter {
+class CONTENT_EXPORT MessagePortMessageFilter : public BrowserMessageFilter,
+ public MessagePortHandler {
public:
typedef base::Callback<int(void)> NextRoutingIDCallback;
@@ -28,6 +40,12 @@ class CONTENT_EXPORT MessagePortMessageFilter : public BrowserMessageFilter {
int GetNextRoutingID();
+ // MessagePortHandler implementation.
+ void SendMessage(int route_id,
+ const base::string16& message,
+ const std::vector<int>& sent_message_port_ids) override;
+ void SendMessagesQueued(int route_id) override;
+
// Updates message ports registered for |message_port_ids| and returns
// new routing IDs for the updated ports via |new_routing_ids|.
void UpdateMessagePortsWithNewRoutes(
« no previous file with comments | « no previous file | content/browser/message_port_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698