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