Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_PUBLIC_ENVIRONMENT_ASYNC_WAITER_H_ | |
| 6 #define MOJO_PUBLIC_ENVIRONMENT_ASYNC_WAITER_H_ | |
| 7 | |
| 8 #include "mojo/public/system/core.h" | |
| 9 | |
| 10 #ifdef __cplusplus | |
| 11 extern "C" { | |
| 12 #endif | |
| 13 | |
| 14 typedef uintptr_t MojoAsyncWaitID; | |
| 15 | |
| 16 typedef void (*MojoAsyncWaitCallback)(uintptr_t user_data, MojoResult result); | |
| 17 | |
| 18 struct MojoAsyncWaiter { | |
| 19 // Asynchronously call MojoWait on a background thread, and pass the result | |
| 20 // of MojoWait to the given MojoAsyncWaitCallback on the current thread. | |
| 21 // Returns a non-zero MojoAsyncWaitID that can be used with CancelWait to | |
| 22 // stop waiting. This identifier becomes invalid once the callback runs. | |
| 23 MojoAsyncWaitID (*AsyncWait)(MojoAsyncWaiter* waiter, | |
| 24 MojoHandle handle, | |
| 25 MojoWaitFlags flags, | |
| 26 MojoDeadline deadline, | |
| 27 MojoAsyncWaitCallback callback, | |
| 28 uintptr_t user_data); | |
| 29 | |
| 30 // Cancel an existing call to AsyncWait with the given MojoAsyncWaitID. The | |
| 31 // corresponding MojoAsyncWaitCallback will not be called in this case. | |
| 32 void (*CancelWait)(MojoAsyncWaiter* waiter, | |
| 33 MojoAsyncWaitID wait_id); | |
| 34 }; | |
| 35 | |
| 36 // Returns the default MojoAsyncWaiter implementation. | |
| 37 MojoAsyncWaiter* MojoGetDefaultAsyncWaiter(); | |
|
viettrungluu
2014/01/13 21:47:44
Will this be needed by the GL library? (As in, wil
| |
| 38 | |
| 39 #ifdef __cplusplus | |
| 40 } // extern "C" | |
| 41 #endif | |
| 42 | |
| 43 #endif // MOJO_PUBLIC_ENVIRONMENT_ASYNC_WAITER_H_ | |
| OLD | NEW |