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

Unified Diff: mojo/edk/system/async_waiter.h

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/BUILD.gn ('k') | mojo/edk/system/async_waiter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/async_waiter.h
diff --git a/mojo/edk/system/async_waiter.h b/mojo/edk/system/async_waiter.h
new file mode 100644
index 0000000000000000000000000000000000000000..da412c032659f7bc9c36d2fe8a194c3a4014a7af
--- /dev/null
+++ b/mojo/edk/system/async_waiter.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_SYSTEM_ASYNC_WAITER_H_
+#define MOJO_EDK_SYSTEM_ASYNC_WAITER_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "mojo/edk/system/awakable.h"
+#include "mojo/edk/system/system_impl_export.h"
+#include "mojo/public/c/system/types.h"
+
+namespace mojo {
+namespace system {
+
+// An |Awakable| implementation that just calls a given callback object.
+class MOJO_SYSTEM_IMPL_EXPORT AsyncWaiter final : public Awakable {
+ public:
+ typedef base::Callback<void(MojoResult)> AwakeCallback;
+
+ // |callback| must satisfy the same contract as |Awakable::Awake()|.
+ explicit AsyncWaiter(AwakeCallback callback);
+ virtual ~AsyncWaiter();
+
+ private:
+ // |Awakable| implementation:
+ bool Awake(MojoResult result, uintptr_t context) override;
+
+ AwakeCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(AsyncWaiter);
+};
+
+} // namespace system
+} // namespace mojo
+
+#endif // MOJO_EDK_SYSTEM_ASYNC_WAITER_H_
« no previous file with comments | « mojo/edk/system/BUILD.gn ('k') | mojo/edk/system/async_waiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698