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

Unified Diff: mojo/edk/system/core.cc

Issue 795593004: Update mojo sdk to rev cc531b32182099a5a034a99daff35ed5d38a61c8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More workarounds for MSVC Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/core_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/core_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698