| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MOJO_EDK_SYSTEM_PORTS_NODE_DELEGATE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_PORTS_NODE_DELEGATE_H_ |
| 6 #define MOJO_EDK_SYSTEM_PORTS_NODE_DELEGATE_H_ | 6 #define MOJO_EDK_SYSTEM_PORTS_NODE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "mojo/edk/system/ports/message.h" | 10 #include "mojo/edk/system/ports/message.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Allocate a message, including a header that can be used by the Node | 25 // Allocate a message, including a header that can be used by the Node |
| 26 // implementation. |num_header_bytes| will be aligned. The newly allocated | 26 // implementation. |num_header_bytes| will be aligned. The newly allocated |
| 27 // memory need not be zero-filled. | 27 // memory need not be zero-filled. |
| 28 virtual void AllocMessage(size_t num_header_bytes, | 28 virtual void AllocMessage(size_t num_header_bytes, |
| 29 ScopedMessage* message) = 0; | 29 ScopedMessage* message) = 0; |
| 30 | 30 |
| 31 // Forward a message asynchronously to the specified node. This method MUST | 31 // Forward a message asynchronously to the specified node. This method MUST |
| 32 // NOT synchronously call any methods on Node. | 32 // NOT synchronously call any methods on Node. |
| 33 virtual void ForwardMessage(const NodeName& node, ScopedMessage message) = 0; | 33 virtual void ForwardMessage(const NodeName& node, ScopedMessage message) = 0; |
| 34 | 34 |
| 35 // Broadcast a message to all nodes. |
| 36 virtual void BroadcastMessage(ScopedMessage message) = 0; |
| 37 |
| 35 // Indicates that the port's status has changed recently. Use Node::GetStatus | 38 // Indicates that the port's status has changed recently. Use Node::GetStatus |
| 36 // to query the latest status of the port. Note, this event could be spurious | 39 // to query the latest status of the port. Note, this event could be spurious |
| 37 // if another thread is simultaneously modifying the status of the port. | 40 // if another thread is simultaneously modifying the status of the port. |
| 38 virtual void PortStatusChanged(const PortRef& port_ref) = 0; | 41 virtual void PortStatusChanged(const PortRef& port_ref) = 0; |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 } // namespace ports | 44 } // namespace ports |
| 42 } // namespace edk | 45 } // namespace edk |
| 43 } // namespace mojo | 46 } // namespace mojo |
| 44 | 47 |
| 45 #endif // MOJO_EDK_SYSTEM_PORTS_NODE_DELEGATE_H_ | 48 #endif // MOJO_EDK_SYSTEM_PORTS_NODE_DELEGATE_H_ |
| OLD | NEW |