| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/public/system/core.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "mojo/system/core_impl.h" | |
| 9 | |
| 10 extern "C" { | |
| 11 | |
| 12 MojoResult MojoClose(MojoHandle handle) { | |
| 13 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 14 return mojo::system::CoreImpl::Get()->Close(handle); | |
| 15 } | |
| 16 | |
| 17 MojoResult MojoWait(MojoHandle handle, | |
| 18 MojoWaitFlags flags, | |
| 19 MojoDeadline deadline) { | |
| 20 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 21 return mojo::system::CoreImpl::Get()->Wait(handle, flags, deadline); | |
| 22 } | |
| 23 | |
| 24 MojoResult MojoWaitMany(const MojoHandle* handles, | |
| 25 const MojoWaitFlags* flags, | |
| 26 uint32_t num_handles, | |
| 27 MojoDeadline deadline) { | |
| 28 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 29 return mojo::system::CoreImpl::Get()->WaitMany(handles, flags, num_handles, | |
| 30 deadline); | |
| 31 } | |
| 32 | |
| 33 MojoResult MojoCreateMessagePipe(MojoHandle* handle_0, MojoHandle* handle_1) { | |
| 34 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 35 return mojo::system::CoreImpl::Get()->CreateMessagePipe(handle_0, handle_1); | |
| 36 } | |
| 37 | |
| 38 MojoResult MojoWriteMessage(MojoHandle handle, | |
| 39 const void* bytes, uint32_t num_bytes, | |
| 40 const MojoHandle* handles, uint32_t num_handles, | |
| 41 MojoWriteMessageFlags flags) { | |
| 42 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 43 return mojo::system::CoreImpl::Get()->WriteMessage(handle, | |
| 44 bytes, num_bytes, | |
| 45 handles, num_handles, | |
| 46 flags); | |
| 47 } | |
| 48 | |
| 49 MojoResult MojoReadMessage(MojoHandle handle, | |
| 50 void* bytes, uint32_t* num_bytes, | |
| 51 MojoHandle* handles, uint32_t* num_handles, | |
| 52 MojoReadMessageFlags flags) { | |
| 53 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 54 return mojo::system::CoreImpl::Get()->ReadMessage(handle, | |
| 55 bytes, num_bytes, | |
| 56 handles, num_handles, | |
| 57 flags); | |
| 58 } | |
| 59 | |
| 60 MojoTimeTicks MojoGetTimeTicksNow() { | |
| 61 DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; | |
| 62 return mojo::system::CoreImpl::Get()->GetTimeTicksNow(); | |
| 63 } | |
| 64 | |
| 65 } // extern "C" | |
| OLD | NEW |