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 29 matching lines...) Expand all Loading... |
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. | 45 // Posts a MessageEvent to a message port associated with a message channel. |
46 static void PostMessageToPort(int sender_port_id, | 46 static void PostMessageToPort(int sender_port_id, |
47 const base::string16& data, | 47 const base::string16& data, |
48 const std::vector<int>& sent_ports); | 48 const std::vector<int>& sent_ports); |
49 | 49 |
| 50 // Close the message port. Should be called on IO thread. |
| 51 static void ClosePort(int message_port_id); |
| 52 |
50 // Cleanup the message ports that belong to the closing delegate. | 53 // Cleanup the message ports that belong to the closing delegate. |
51 static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate); | 54 static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate); |
52 | 55 |
53 private: | 56 private: |
54 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); | 57 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); |
55 }; | 58 }; |
56 | 59 |
57 } // namespace content | 60 } // namespace content |
58 | 61 |
59 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ | 62 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
OLD | NEW |