OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Creates a message channel and provide the ids of the message ports that are | 35 // Creates a message channel and provide the ids of the message ports that are |
36 // associated with this message channel. | 36 // associated with this message channel. |
37 // See https://html.spec.whatwg.org/multipage/comms.html#messagechannel | 37 // See https://html.spec.whatwg.org/multipage/comms.html#messagechannel |
38 // Should be called on IO thread. | 38 // Should be called on IO thread. |
39 // The message ports that are created will have their routing id numbers equal | 39 // The message ports that are created will have their routing id numbers equal |
40 // to the message port numbers. | 40 // to the message port numbers. |
41 static void CreateMessageChannel(MessagePortDelegate* delegate, | 41 static void CreateMessageChannel(MessagePortDelegate* delegate, |
42 int* port1, | 42 int* port1, |
43 int* port2); | 43 int* port2); |
44 | 44 |
| 45 // Posts a MessageEvent to a message port associated with a message channel. |
| 46 static void PostMessageToPort(int sender_port_id, |
| 47 const base::string16& data, |
| 48 const std::vector<int>& sent_ports); |
| 49 |
45 // Cleanup the message ports that belong to the closing delegate. | 50 // Cleanup the message ports that belong to the closing delegate. |
46 static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate); | 51 static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate); |
47 | 52 |
48 private: | 53 private: |
49 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); | 54 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); |
50 }; | 55 }; |
51 | 56 |
52 } // namespace content | 57 } // namespace content |
53 | 58 |
54 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ | 59 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
OLD | NEW |