| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Posts a MessageEvent to a message port associated with a message channel. | 48 // Posts a MessageEvent to a message port associated with a message channel. |
| 49 static void PostMessageToPort( | 49 static void PostMessageToPort( |
| 50 int sender_port_id, | 50 int sender_port_id, |
| 51 const MessagePortMessage& message, | 51 const MessagePortMessage& message, |
| 52 const std::vector<TransferredMessagePort>& sent_ports); | 52 const std::vector<TransferredMessagePort>& sent_ports); |
| 53 | 53 |
| 54 // Close the message port. Should be called on IO thread. | 54 // Close the message port. Should be called on IO thread. |
| 55 static void ClosePort(int message_port_id); | 55 static void ClosePort(int message_port_id); |
| 56 | 56 |
| 57 // Queue up all the messages for this message port until ReleaseMessages |
| 58 // is called. Should be called on IO thread. |
| 59 static void HoldMessages(int message_port_id); |
| 60 |
| 61 // Release any queued messages as a result of HoldMessages. Should be |
| 62 // called on IO thread. |
| 63 static void ReleaseMessages(int message_port_id); |
| 64 |
| 57 // Cleanup the message ports that belong to the closing delegate. | 65 // Cleanup the message ports that belong to the closing delegate. |
| 58 static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate); | 66 static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate); |
| 59 | 67 |
| 60 private: | 68 private: |
| 61 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); | 69 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider); |
| 62 }; | 70 }; |
| 63 | 71 |
| 64 } // namespace content | 72 } // namespace content |
| 65 | 73 |
| 66 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ | 74 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_PROVIDER_H_ |
| OLD | NEW |