Chromium Code Reviews| Index: mojo/edk/system/awakable.h |
| diff --git a/mojo/edk/system/awakable.h b/mojo/edk/system/awakable.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d0cc889fd38062f479f454b0898a3cf97e76bf9e |
| --- /dev/null |
| +++ b/mojo/edk/system/awakable.h |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2013 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_AWAKABLE_H_ |
| +#define MOJO_EDK_SYSTEM_AWAKABLE_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "mojo/public/c/system/types.h" |
| + |
| +namespace mojo { |
| +namespace system { |
| + |
| +// Awakable is a callback that is called by AwakableList. |
|
viettrungluu
2014/12/03 21:18:13
nit: For consistency with the rest of the director
Hajime Morrita
2014/12/03 21:44:09
Done.
|
| +// The Awake() callback must satisfy following contract: |
|
viettrungluu
2014/12/03 21:18:13
Put this comment above |Awake()|. You can rewrite
Hajime Morrita
2014/12/03 21:44:09
Done.
|
| +// |
| +// * As it is called from any thread, the callback must be thread-safe. |
|
viettrungluu
2014/12/03 21:18:13
"it" -> "this", "the callback" -> "this"
Hajime Morrita
2014/12/03 21:44:09
Done.
|
| +// * As it is called inside a lock, the callback must not call API that |
|
viettrungluu
2014/12/03 21:18:13
"it" -> "this", "the callback" -> "this"
More sig
Hajime Morrita
2014/12/03 21:44:09
That is right. "any lock" is unnecessarily restric
|
| +// does lock any Mojo-related objects. |
| +class Awakable { |
| + public: |
| + virtual void Awake(MojoResult result, uintptr_t context) = 0; |
| +}; |
| + |
| +} // namespace system |
| +} // namespace mojo |
| + |
| +#endif // MOJO_EDK_SYSTEM_AWAKABLE_H_ |