| Index: mojo/edk/system/core.cc
|
| diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
|
| index 3843d9714a7702c36e2290e382976eaf0c08388b..6189e5031d11c231537448348da03a37a5124ac2 100644
|
| --- a/mojo/edk/system/core.cc
|
| +++ b/mojo/edk/system/core.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/time/time.h"
|
| #include "mojo/edk/embedder/platform_shared_buffer.h"
|
| #include "mojo/edk/embedder/platform_support.h"
|
| +#include "mojo/edk/system/async_waiter.h"
|
| #include "mojo/edk/system/configuration.h"
|
| #include "mojo/edk/system/data_pipe.h"
|
| #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
|
| @@ -97,6 +98,19 @@ scoped_refptr<Dispatcher> Core::GetDispatcher(MojoHandle handle) {
|
| return handle_table_.GetDispatcher(handle);
|
| }
|
|
|
| +MojoResult Core::AsyncWait(MojoHandle handle,
|
| + MojoHandleSignals signals,
|
| + base::Callback<void(MojoResult)> callback) {
|
| + scoped_refptr<Dispatcher> dispatcher = GetDispatcher(handle);
|
| + DCHECK(dispatcher);
|
| +
|
| + scoped_ptr<AsyncWaiter> waiter = make_scoped_ptr(new AsyncWaiter(callback));
|
| + MojoResult rv = dispatcher->AddAwakable(waiter.get(), signals, 0, nullptr);
|
| + if (rv == MOJO_RESULT_OK)
|
| + ignore_result(waiter.release());
|
| + return rv;
|
| +}
|
| +
|
| MojoTimeTicks Core::GetTimeTicksNow() {
|
| return base::TimeTicks::Now().ToInternalValue();
|
| }
|
|
|