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

Unified Diff: mojo/public/bindings/lib/remote_ptr.h

Issue 134253004: Mojo: AsyncWaiter and mojo/public/environment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing files Created 6 years, 11 months 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
Index: mojo/public/bindings/lib/remote_ptr.h
diff --git a/mojo/public/bindings/lib/remote_ptr.h b/mojo/public/bindings/lib/remote_ptr.h
index a0c42e33c64dabd946f2f0e8e7e479e8538d4983..3ab5fb20af46416fd44370084b968b2765ed3eeb 100644
--- a/mojo/public/bindings/lib/remote_ptr.h
+++ b/mojo/public/bindings/lib/remote_ptr.h
@@ -48,13 +48,15 @@ namespace mojo {
//
template <typename S>
class RemotePtr {
+ struct State;
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(RemotePtr, RValue);
public:
RemotePtr() : state_(NULL) {}
explicit RemotePtr(ScopedMessagePipeHandle message_pipe,
- typename S::_Peer* peer = NULL)
- : state_(new State(message_pipe.Pass(), peer)) {
+ typename S::_Peer* peer = NULL,
+ MojoAsyncWaiter* waiter = GetDefaultAsyncWaiter())
+ : state_(new State(message_pipe.Pass(), peer, waiter)) {
}
// Move-only constructor and operator=.
@@ -87,9 +89,10 @@ class RemotePtr {
}
void reset(ScopedMessagePipeHandle message_pipe,
- typename S::_Peer* peer = NULL) {
+ typename S::_Peer* peer = NULL,
+ MojoAsyncWaiter* waiter = GetDefaultAsyncWaiter()) {
delete state_;
- state_ = new State(message_pipe.Pass(), peer);
+ state_ = new State(message_pipe.Pass(), peer, waiter);
}
bool encountered_error() const {
@@ -99,8 +102,9 @@ class RemotePtr {
private:
struct State {
- State(ScopedMessagePipeHandle message_pipe, typename S::_Peer* peer)
- : connector(message_pipe.Pass()),
+ State(ScopedMessagePipeHandle message_pipe, typename S::_Peer* peer,
+ MojoAsyncWaiter* waiter)
+ : connector(message_pipe.Pass(), waiter),
proxy(&connector),
stub(peer) {
if (peer)

Powered by Google App Engine
This is Rietveld 408576698