| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DATA_PIPE_PRODUCER_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ |
| 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 DataPipeProducerDispatcher( | 34 DataPipeProducerDispatcher( |
| 35 NodeController* node_controller, | 35 NodeController* node_controller, |
| 36 const ports::PortRef& port, | 36 const ports::PortRef& port, |
| 37 scoped_refptr<PlatformSharedBuffer> shared_ring_buffer, | 37 scoped_refptr<PlatformSharedBuffer> shared_ring_buffer, |
| 38 const MojoCreateDataPipeOptions& options, | 38 const MojoCreateDataPipeOptions& options, |
| 39 bool initialized, | 39 bool initialized, |
| 40 uint64_t pipe_id); | 40 uint64_t pipe_id); |
| 41 | 41 |
| 42 // Dispatcher: | 42 // Dispatcher: |
| 43 Type GetType() const override; | 43 Type GetType() const override; |
| 44 MojoResult Close() override; | 44 MojoResult Close(RequestContext* request_context) override; |
| 45 MojoResult WriteData(const void* elements, | 45 MojoResult WriteData(const void* elements, |
| 46 uint32_t* num_bytes, | 46 uint32_t* num_bytes, |
| 47 MojoReadDataFlags flags) override; | 47 MojoReadDataFlags flags) override; |
| 48 MojoResult BeginWriteData(void** buffer, | 48 MojoResult BeginWriteData(void** buffer, |
| 49 uint32_t* buffer_num_bytes, | 49 uint32_t* buffer_num_bytes, |
| 50 MojoWriteDataFlags flags) override; | 50 MojoWriteDataFlags flags) override; |
| 51 MojoResult EndWriteData(uint32_t num_bytes_written) override; | 51 MojoResult EndWriteData(uint32_t num_bytes_written) override; |
| 52 HandleSignalsState GetHandleSignalsState() const override; | 52 HandleSignalsState GetHandleSignalsState() const override; |
| 53 MojoResult AddAwakable(Awakable* awakable, | 53 MojoResult AddAwakable(Awakable* awakable, |
| 54 MojoHandleSignals signals, | 54 MojoHandleSignals signals, |
| 55 uintptr_t context, | 55 uintptr_t context, |
| 56 HandleSignalsState* signals_state) override; | 56 HandleSignalsState* signals_state) override; |
| 57 void RemoveAwakable(Awakable* awakable, | 57 void RemoveAwakable(Awakable* awakable, |
| 58 HandleSignalsState* signals_state) override; | 58 HandleSignalsState* signals_state) override; |
| 59 void StartSerialize(uint32_t* num_bytes, | 59 void StartSerialize(uint32_t* num_bytes, |
| 60 uint32_t* num_ports, | 60 uint32_t* num_ports, |
| 61 uint32_t* num_handles) override; | 61 uint32_t* num_handles) override; |
| 62 bool EndSerialize(void* destination, | 62 bool EndSerialize(void* destination, |
| 63 ports::PortName* ports, | 63 ports::PortName* ports, |
| 64 PlatformHandle* handles) override; | 64 PlatformHandle* handles) override; |
| 65 bool BeginTransit() override; | 65 bool BeginTransit(RequestContext* request_context) override; |
| 66 void CompleteTransitAndClose() override; | 66 void CompleteTransitAndClose(RequestContext* request_context) override; |
| 67 void CancelTransit() override; | 67 void CancelTransit(RequestContext* request_context) override; |
| 68 | 68 |
| 69 static scoped_refptr<DataPipeProducerDispatcher> | 69 static scoped_refptr<DataPipeProducerDispatcher> |
| 70 Deserialize(const void* data, | 70 Deserialize(const void* data, |
| 71 size_t num_bytes, | 71 size_t num_bytes, |
| 72 const ports::PortName* ports, | 72 const ports::PortName* ports, |
| 73 size_t num_ports, | 73 size_t num_ports, |
| 74 PlatformHandle* handles, | 74 PlatformHandle* handles, |
| 75 size_t num_handles); | 75 size_t num_handles); |
| 76 | 76 |
| 77 private: | 77 private: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 uint32_t write_offset_ = 0; | 115 uint32_t write_offset_ = 0; |
| 116 uint32_t available_capacity_; | 116 uint32_t available_capacity_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(DataPipeProducerDispatcher); | 118 DISALLOW_COPY_AND_ASSIGN(DataPipeProducerDispatcher); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace edk | 121 } // namespace edk |
| 122 } // namespace mojo | 122 } // namespace mojo |
| 123 | 123 |
| 124 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ | 124 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ |
| OLD | NEW |