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

Side by Side Diff: mojo/edk/system/async_waiter.h

Issue 798993003: Add embedder::AsyncWait() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
(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 #ifndef MOJO_EDK_SYSTEM_ASYNC_WAITER_H_
6 #define MOJO_EDK_SYSTEM_ASYNC_WAITER_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h"
viettrungluu 2014/12/12 21:39:30 Don't need this include.
gmorrita 2014/12/12 22:56:27 Done.
11 #include "mojo/edk/system/awakable.h"
12 #include "mojo/edk/system/dispatcher.h"
viettrungluu 2014/12/12 21:39:31 Nor this.
gmorrita 2014/12/12 22:56:27 Done.
13 #include "mojo/edk/system/handle_signals_state.h"
viettrungluu 2014/12/12 21:39:31 "
gmorrita 2014/12/12 22:56:27 Done.
14 #include "mojo/edk/system/system_impl_export.h"
15 #include "mojo/public/c/system/types.h"
16
17 namespace mojo {
18 namespace system {
19
20 // An |Awakable| implementation that just calls a given callback object.
21 class MOJO_SYSTEM_IMPL_EXPORT AsyncWaiter : public Awakable {
22 public:
23 typedef base::Callback<void(MojoResult)> AwakeCallback;
24
25 // |callback| must satisfy the same contract as |Awakable::Awake()|.
26 AsyncWaiter(AwakeCallback callback);
viettrungluu 2014/12/12 21:39:31 explicit
gmorrita 2014/12/12 22:56:28 Done.
27 virtual ~AsyncWaiter();
viettrungluu 2014/12/12 21:39:31 This doesn't need to be virtual. (Possibly, you sh
gmorrita 2014/12/12 22:56:27 Our clang plugin complains about this :-/
28
29 private:
30 // |Awakable| implementation:
31 bool Awake(MojoResult result, uintptr_t context) override;
32
33 AwakeCallback callback_;
34
35 DISALLOW_COPY_AND_ASSIGN(AsyncWaiter);
36 };
37
38 } // namespace system
39 } // namespace mojo
40
41 #endif // MOJO_EDK_SYSTEM_ASYNC_WAITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698