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 MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
6 #define MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 size_t num_ports, | 60 size_t num_ports, |
61 PlatformHandle* platform_handles, | 61 PlatformHandle* platform_handles, |
62 size_t num_platform_handles); | 62 size_t num_platform_handles); |
63 | 63 |
64 // Passes the underlying platform shared buffer. This dispatcher must be | 64 // Passes the underlying platform shared buffer. This dispatcher must be |
65 // closed after calling this function. | 65 // closed after calling this function. |
66 scoped_refptr<PlatformSharedBuffer> PassPlatformSharedBuffer(); | 66 scoped_refptr<PlatformSharedBuffer> PassPlatformSharedBuffer(); |
67 | 67 |
68 // Dispatcher: | 68 // Dispatcher: |
69 Type GetType() const override; | 69 Type GetType() const override; |
70 MojoResult Close() override; | 70 MojoResult Close(RequestContext* request_context) override; |
71 MojoResult DuplicateBufferHandle( | 71 MojoResult DuplicateBufferHandle( |
72 const MojoDuplicateBufferHandleOptions* options, | 72 const MojoDuplicateBufferHandleOptions* options, |
73 scoped_refptr<Dispatcher>* new_dispatcher) override; | 73 scoped_refptr<Dispatcher>* new_dispatcher) override; |
74 MojoResult MapBuffer( | 74 MojoResult MapBuffer( |
75 uint64_t offset, | 75 uint64_t offset, |
76 uint64_t num_bytes, | 76 uint64_t num_bytes, |
77 MojoMapBufferFlags flags, | 77 MojoMapBufferFlags flags, |
78 scoped_ptr<PlatformSharedBufferMapping>* mapping) override; | 78 scoped_ptr<PlatformSharedBufferMapping>* mapping) override; |
79 void StartSerialize(uint32_t* num_bytes, | 79 void StartSerialize(uint32_t* num_bytes, |
80 uint32_t* num_ports, | 80 uint32_t* num_ports, |
81 uint32_t* num_platform_handles) override; | 81 uint32_t* num_platform_handles) override; |
82 bool EndSerialize(void* destination, | 82 bool EndSerialize(void* destination, |
83 ports::PortName* ports, | 83 ports::PortName* ports, |
84 PlatformHandle* handles) override; | 84 PlatformHandle* handles) override; |
85 bool BeginTransit() override; | 85 bool BeginTransit(RequestContext* request_context) override; |
86 void CompleteTransitAndClose() override; | 86 void CompleteTransitAndClose(RequestContext* request_context) override; |
87 void CancelTransit() override; | 87 void CancelTransit(RequestContext* request_context) override; |
88 | 88 |
89 private: | 89 private: |
90 static scoped_refptr<SharedBufferDispatcher> CreateInternal( | 90 static scoped_refptr<SharedBufferDispatcher> CreateInternal( |
91 scoped_refptr<PlatformSharedBuffer> shared_buffer) { | 91 scoped_refptr<PlatformSharedBuffer> shared_buffer) { |
92 return make_scoped_refptr( | 92 return make_scoped_refptr( |
93 new SharedBufferDispatcher(std::move(shared_buffer))); | 93 new SharedBufferDispatcher(std::move(shared_buffer))); |
94 } | 94 } |
95 | 95 |
96 explicit SharedBufferDispatcher( | 96 explicit SharedBufferDispatcher( |
97 scoped_refptr<PlatformSharedBuffer> shared_buffer); | 97 scoped_refptr<PlatformSharedBuffer> shared_buffer); |
(...skipping 19 matching lines...) Expand all Loading... |
117 | 117 |
118 scoped_refptr<PlatformSharedBuffer> shared_buffer_; | 118 scoped_refptr<PlatformSharedBuffer> shared_buffer_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher); | 120 DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace edk | 123 } // namespace edk |
124 } // namespace mojo | 124 } // namespace mojo |
125 | 125 |
126 #endif // MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ | 126 #endif // MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
OLD | NEW |