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

Unified Diff: content/browser/message_port_delegate.h

Issue 785133006: Enable messaging over a navigator.connect initiated channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigator-connect_serviceside
Patch Set: improve comments 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
Index: content/browser/message_port_delegate.h
diff --git a/content/browser/message_port_delegate.h b/content/browser/message_port_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..6854a96777b7532e6e8b6eca8d952fca0b413c71
--- /dev/null
+++ b/content/browser/message_port_delegate.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_MESSAGE_PORT_DELEGATE_H_
+#define CONTENT_BROWSER_MESSAGE_PORT_DELEGATE_H_
+
+#include <vector>
+#include "base/strings/string16.h"
Avi (use Gerrit) 2014/12/19 21:58:14 space before this line
Marijn Kruisselbrink 2014/12/19 22:13:07 Done.
+
+namespace content {
+
+// Delegate used by MessagePortService to send messages to message ports to the
+// correct renderer. Delegates are responsible for managing their own lifetime,
+// and should call MessagePortService::OnMessagePortDelegateClosing if they are
+// destroyed while there are still message ports associated with them.
+class MessagePortDelegate {
+ public:
+ // Sends a message to the given route. Implementations are responsible for
+ // updating MessagePortService with new routes for the sent message ports.
+ virtual void SendMessage(int route_id,
+ const base::string16& message,
+ const std::vector<int>& sent_message_port_ids) = 0;
Avi (use Gerrit) 2014/12/19 21:58:14 set?
Marijn Kruisselbrink 2014/12/19 22:13:07 I'm pretty sure this actually has to be an ordered
+
+ // Sends a "messages are queued" IPC to the given route.
+ virtual void SendMessagesAreQueued(int route_id) = 0;
+
+ protected:
+ virtual ~MessagePortDelegate() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MESSAGE_PORT_DELEGATE_H_
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover_unittest.cc ('k') | content/browser/message_port_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698