Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: mojo/edk/embedder/entrypoints.cc

Issue 1783623005: Add mojo/c/system/{time.h,wait.h}. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/handle.h"
10 #include "mojo/public/c/system/message_pipe.h" 10 #include "mojo/public/c/system/message_pipe.h"
11 #include "mojo/public/c/system/time.h"
12 #include "mojo/public/c/system/wait.h"
11 13
12 using mojo::embedder::internal::g_core; 14 using mojo::embedder::internal::g_core;
13 using mojo::system::MakeUserPointer; 15 using mojo::system::MakeUserPointer;
14 16
15 // Definitions of the system functions. 17 // Definitions of the system functions.
16 extern "C" { 18 extern "C" {
17 19
18 MojoTimeTicks MojoGetTimeTicksNow() { 20 MojoTimeTicks MojoGetTimeTicksNow() {
19 return g_core->GetTimeTicksNow(); 21 return g_core->GetTimeTicksNow();
20 } 22 }
21 23
22 MojoResult MojoClose(MojoHandle handle) { 24 MojoResult MojoClose(MojoHandle handle) {
23 return g_core->Close(handle); 25 return g_core->Close(handle);
24 } 26 }
25 27
26 MojoResult MojoWait(MojoHandle handle, 28 MojoResult MojoWait(MojoHandle handle,
27 MojoHandleSignals signals, 29 MojoHandleSignals signals,
28 MojoDeadline deadline, 30 MojoDeadline deadline,
29 MojoHandleSignalsState* signals_state) { 31 MojoHandleSignalsState* signals_state) {
30 return g_core->Wait(handle, signals, deadline, 32 return g_core->Wait(handle, signals, deadline,
31 MakeUserPointer(signals_state)); 33 MakeUserPointer(signals_state));
32 } 34 }
33 35
34 MojoResult MojoWaitMany(const MojoHandle* handles, 36 MojoResult MojoWaitMany(const MojoHandle* handles,
35 const MojoHandleSignals* signals, 37 const MojoHandleSignals* signals,
36 uint32_t num_handles, 38 uint32_t num_handles,
37 MojoDeadline deadline, 39 MojoDeadline deadline,
38 uint32_t* result_index, 40 uint32_t* result_index,
39 MojoHandleSignalsState* signals_states) { 41 MojoHandleSignalsState* signals_states) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 MojoMapBufferFlags flags) { 156 MojoMapBufferFlags flags) {
155 return g_core->MapBuffer(buffer_handle, offset, num_bytes, 157 return g_core->MapBuffer(buffer_handle, offset, num_bytes,
156 MakeUserPointer(buffer), flags); 158 MakeUserPointer(buffer), flags);
157 } 159 }
158 160
159 MojoResult MojoUnmapBuffer(void* buffer) { 161 MojoResult MojoUnmapBuffer(void* buffer) {
160 return g_core->UnmapBuffer(MakeUserPointer(buffer)); 162 return g_core->UnmapBuffer(MakeUserPointer(buffer));
161 } 163 }
162 164
163 } // extern "C" 165 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698