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

Unified Diff: content/public/browser/message_port_provider.h

Issue 2375133002: Move MessagePort implementation from android_webview to content (Closed)
Patch Set: rsesek nits and git cl format Created 4 years, 2 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
« no previous file with comments | « content/public/browser/android/app_web_message_port_service.h ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/message_port_provider.h
diff --git a/content/public/browser/message_port_provider.h b/content/public/browser/message_port_provider.h
index 8a842b4ed5bffd8c55db7e56508b595d27f0f4a9..e01bd758b3dfdf64127564074e2b131c1d06307b 100644
--- a/content/public/browser/message_port_provider.h
+++ b/content/public/browser/message_port_provider.h
@@ -8,13 +8,15 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/singleton.h"
#include "base/strings/string16.h"
#include "content/common/content_export.h"
namespace content {
-class MessagePortDelegate;
+class AppWebMessagePortService;
class WebContents;
+class MessagePortDelegate;
// An interface consisting of methods that can be called to use Message ports.
class CONTENT_EXPORT MessagePortProvider {
@@ -32,44 +34,9 @@ class CONTENT_EXPORT MessagePortProvider {
const base::string16& data,
const std::vector<int>& ports);
- // Creates a message channel and provide the ids of the message ports that are
- // associated with this message channel.
- // See https://html.spec.whatwg.org/multipage/comms.html#messagechannel
- // Should be called on IO thread.
- // The message ports that are created will have their routing id numbers equal
- // to the message port numbers.
- static void CreateMessageChannel(MessagePortDelegate* delegate,
- int* port1,
- int* port2);
-
- // Posts a MessageEvent to a message port associated with a message channel.
- // Should be called on IO thread.
- static void PostMessageToPort(
- int sender_port_id,
- const base::string16& message,
- const std::vector<int>& sent_ports);
-
- // Close the message port. Should be called on IO thread.
- static void ClosePort(int message_port_id);
-
- // Queue up all the messages for this message port until ReleaseMessages
- // is called. Should be called on IO thread.
- static void HoldMessages(int message_port_id);
-
- // Release any queued messages as a result of HoldMessages. Should be
- // called on IO thread.
- static void ReleaseMessages(int message_port_id);
-
- // Cleanup the message ports that belong to the closing delegate.
- // Should be called on IO thread.
- static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate);
-
- // Update message port information when the message port is transferred
- // from a different process. The updated message ports will have their
- // routing numbers equal to the message port numbers.
- // Should be called on IO thread.
- static void UpdateMessagePort(int message_port_id,
- MessagePortDelegate* delegate);
+#if defined(OS_ANDROID)
+ static content::AppWebMessagePortService* GetAppWebMessagePortService();
+#endif
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider);
« no previous file with comments | « content/public/browser/android/app_web_message_port_service.h ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698