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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2c91c36511c639a80a4dbf8b7368c0ed81ae55fe |
--- /dev/null |
+++ b/content/public/browser/message_port_provider.h |
@@ -0,0 +1,39 @@ |
+// Copyright (c) 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_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
+#define CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
+ |
+#include <vector> |
+ |
+#include "base/basictypes.h" |
+#include "base/macros.h" |
+#include "base/strings/string16.h" |
+#include "content/common/content_export.h" |
+ |
+namespace content { |
+ |
+class WebContents; |
+ |
+// An interface consisting of methods that can be called to use Message ports. |
+class CONTENT_EXPORT MessagePortProvider { |
+ public: |
+ // Should be called on IO Thread. |
+ static void PostMessageToFrame(WebContents* web_contents, |
jochen (gone - plz use gerrit)
2014/11/18 13:29:41
please document what these methods do and how you'
sgurun-gerrit only
2014/11/18 22:51:55
Done.
|
+ base::string16* source_origin, |
jochen (gone - plz use gerrit)
2014/11/18 13:29:41
why aren't these const refs?
sgurun-gerrit only
2014/11/18 22:51:55
Done.
|
+ base::string16* target_origin, |
+ base::string16* data, |
+ std::vector<int>* ports); |
+ // Should be called on IO Thread. |
+ static void CreateMessageChannel(WebContents* web_contents, |
+ int* port1, |
+ int* port2); |
+ |
+ private: |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |