OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_EDK_SYSTEM_DATA_PIPE_CONTROL_MESSAGE_H_ |
| 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_CONTROL_MESSAGE_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 12 #include "mojo/edk/system/ports/port_ref.h" |
| 13 #include "mojo/public/c/system/macros.h" |
| 14 |
| 15 namespace mojo { |
| 16 namespace edk { |
| 17 |
| 18 class NodeController; |
| 19 class PortsMessage; |
| 20 |
| 21 enum DataPipeCommand : uint32_t { |
| 22 // Signal to the consumer that new data is available. |
| 23 DATA_WAS_WRITTEN, |
| 24 |
| 25 // Signal to the producer that data has been consumed. |
| 26 DATA_WAS_READ, |
| 27 }; |
| 28 |
| 29 // Message header for messages sent over a data pipe control port. |
| 30 struct MOJO_ALIGNAS(8) DataPipeControlMessage { |
| 31 DataPipeCommand command; |
| 32 uint32_t num_bytes; |
| 33 }; |
| 34 |
| 35 void SendDataPipeControlMessage(NodeController* node_controller, |
| 36 const ports::PortRef& port, |
| 37 DataPipeCommand command, |
| 38 uint32_t num_bytes); |
| 39 |
| 40 } // namespace edk |
| 41 } // namespace mojo |
| 42 |
| 43 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_CONTROL_MESSAGE_H_ |
OLD | NEW |