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/system/entrypoints.h" | 5 #include "mojo/system/entrypoints.h" |
6 | 6 |
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 #include "mojo/system/core.h" | 11 #include "mojo/system/core.h" |
12 | 12 |
13 static mojo::system::Core* g_core = NULL; | 13 static mojo::system::Core* g_core = NULL; |
14 | 14 |
15 using mojo::system::MakeUserPointer; | 15 using mojo::system::MakeUserPointer; |
16 using mojo::system::MakeUserPointerValue; | |
17 | 16 |
18 namespace mojo { | 17 namespace mojo { |
19 namespace system { | 18 namespace system { |
20 namespace entrypoints { | 19 namespace entrypoints { |
21 | 20 |
22 void SetCore(Core* core) { | 21 void SetCore(Core* core) { |
23 g_core = core; | 22 g_core = core; |
24 } | 23 } |
25 | 24 |
26 Core* GetCore() { | 25 Core* GetCore() { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void** buffer, | 175 void** buffer, |
177 MojoMapBufferFlags flags) { | 176 MojoMapBufferFlags flags) { |
178 return g_core->MapBuffer(buffer_handle, | 177 return g_core->MapBuffer(buffer_handle, |
179 offset, | 178 offset, |
180 num_bytes, | 179 num_bytes, |
181 MakeUserPointer(buffer), | 180 MakeUserPointer(buffer), |
182 flags); | 181 flags); |
183 } | 182 } |
184 | 183 |
185 MojoResult MojoUnmapBuffer(void* buffer) { | 184 MojoResult MojoUnmapBuffer(void* buffer) { |
186 return g_core->UnmapBuffer(MakeUserPointerValue(buffer)); | 185 return g_core->UnmapBuffer(MakeUserPointer(buffer)); |
187 } | 186 } |
188 | 187 |
189 } // extern "C" | 188 } // extern "C" |
OLD | NEW |