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 #include "mojo/edk/embedder/embedder_internal.h" | 5 #include "mojo/edk/embedder/embedder_internal.h" |
6 #include "mojo/edk/system/core.h" | 6 #include "mojo/edk/system/core.h" |
7 #include "mojo/public/c/system/buffer.h" | 7 #include "mojo/public/c/system/buffer.h" |
8 #include "mojo/public/c/system/data_pipe.h" | 8 #include "mojo/public/c/system/data_pipe.h" |
9 #include "mojo/public/c/system/functions.h" | 9 #include "mojo/public/c/system/functions.h" |
10 #include "mojo/public/c/system/message_pipe.h" | 10 #include "mojo/public/c/system/message_pipe.h" |
11 | 11 |
12 using mojo::embedder::internal::g_core; | 12 using mojo::embedder::internal::g_core; |
13 using mojo::system::MakeUserPointer; | 13 using mojo::system::MakeUserPointer; |
14 | 14 |
15 // Definitions of the system functions. | 15 // Definitions of the system functions. |
16 extern "C" { | 16 extern "C" { |
| 17 |
17 MojoTimeTicks MojoGetTimeTicksNow() { | 18 MojoTimeTicks MojoGetTimeTicksNow() { |
18 return g_core->GetTimeTicksNow(); | 19 return g_core->GetTimeTicksNow(); |
19 } | 20 } |
20 | 21 |
21 MojoResult MojoClose(MojoHandle handle) { | 22 MojoResult MojoClose(MojoHandle handle) { |
22 return g_core->Close(handle); | 23 return g_core->Close(handle); |
23 } | 24 } |
24 | 25 |
25 MojoResult MojoWait(MojoHandle handle, | 26 MojoResult MojoWait(MojoHandle handle, |
26 MojoHandleSignals signals, | 27 MojoHandleSignals signals, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 133 } |
133 | 134 |
134 MojoResult MojoDuplicateBufferHandle( | 135 MojoResult MojoDuplicateBufferHandle( |
135 MojoHandle buffer_handle, | 136 MojoHandle buffer_handle, |
136 const struct MojoDuplicateBufferHandleOptions* options, | 137 const struct MojoDuplicateBufferHandleOptions* options, |
137 MojoHandle* new_buffer_handle) { | 138 MojoHandle* new_buffer_handle) { |
138 return g_core->DuplicateBufferHandle(buffer_handle, MakeUserPointer(options), | 139 return g_core->DuplicateBufferHandle(buffer_handle, MakeUserPointer(options), |
139 MakeUserPointer(new_buffer_handle)); | 140 MakeUserPointer(new_buffer_handle)); |
140 } | 141 } |
141 | 142 |
| 143 MojoResult MojoGetBufferInformation(MojoHandle buffer_handle, |
| 144 struct MojoBufferInformation* info, |
| 145 uint32_t info_num_bytes) { |
| 146 return g_core->GetBufferInformation(buffer_handle, MakeUserPointer(info), |
| 147 info_num_bytes); |
| 148 } |
| 149 |
142 MojoResult MojoMapBuffer(MojoHandle buffer_handle, | 150 MojoResult MojoMapBuffer(MojoHandle buffer_handle, |
143 uint64_t offset, | 151 uint64_t offset, |
144 uint64_t num_bytes, | 152 uint64_t num_bytes, |
145 void** buffer, | 153 void** buffer, |
146 MojoMapBufferFlags flags) { | 154 MojoMapBufferFlags flags) { |
147 return g_core->MapBuffer(buffer_handle, offset, num_bytes, | 155 return g_core->MapBuffer(buffer_handle, offset, num_bytes, |
148 MakeUserPointer(buffer), flags); | 156 MakeUserPointer(buffer), flags); |
149 } | 157 } |
150 | 158 |
151 MojoResult MojoUnmapBuffer(void* buffer) { | 159 MojoResult MojoUnmapBuffer(void* buffer) { |
152 return g_core->UnmapBuffer(MakeUserPointer(buffer)); | 160 return g_core->UnmapBuffer(MakeUserPointer(buffer)); |
153 } | 161 } |
154 | 162 |
155 } // extern "C" | 163 } // extern "C" |
OLD | NEW |