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

Side by Side Diff: mojo/public/cpp/bindings/lib/connector.h

Issue 409943003: Makes HandleWatcher block until no longer waiting on pipe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more java fixes Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_
7 7
8 #include "mojo/public/c/environment/async_waiter.h" 8 #include "mojo/public/c/environment/async_waiter.h"
9 #include "mojo/public/cpp/bindings/lib/message_queue.h" 9 #include "mojo/public/cpp/bindings/lib/message_queue.h"
10 #include "mojo/public/cpp/bindings/message.h" 10 #include "mojo/public/cpp/bindings/message.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void WaitToReadMore(); 78 void WaitToReadMore();
79 79
80 // Returns false if |this| was destroyed during message dispatch. 80 // Returns false if |this| was destroyed during message dispatch.
81 MOJO_WARN_UNUSED_RESULT bool ReadSingleMessage(MojoResult* read_result); 81 MOJO_WARN_UNUSED_RESULT bool ReadSingleMessage(MojoResult* read_result);
82 82
83 // |this| can be destroyed during message dispatch. 83 // |this| can be destroyed during message dispatch.
84 void ReadAllAvailableMessages(); 84 void ReadAllAvailableMessages();
85 85
86 void NotifyError(); 86 void NotifyError();
87 87
88 // Cancels any calls made to |waiter_|.
89 void CancelWait();
90
88 ErrorHandler* error_handler_; 91 ErrorHandler* error_handler_;
89 const MojoAsyncWaiter* waiter_; 92 const MojoAsyncWaiter* waiter_;
90 93
91 ScopedMessagePipeHandle message_pipe_; 94 ScopedMessagePipeHandle message_pipe_;
92 MessageReceiver* incoming_receiver_; 95 MessageReceiver* incoming_receiver_;
93 96
94 MojoAsyncWaitID async_wait_id_; 97 MojoAsyncWaitID async_wait_id_;
95 bool error_; 98 bool error_;
96 bool drop_writes_; 99 bool drop_writes_;
97 bool enforce_errors_from_incoming_receiver_; 100 bool enforce_errors_from_incoming_receiver_;
98 101
99 // If non-null, this will be set to true when the Connector is destroyed. We 102 // If non-null, this will be set to true when the Connector is destroyed. We
100 // use this flag to allow for the Connector to be destroyed as a side-effect 103 // use this flag to allow for the Connector to be destroyed as a side-effect
101 // of dispatching an incoming message. 104 // of dispatching an incoming message.
102 bool* destroyed_flag_; 105 bool* destroyed_flag_;
103 106
104 MOJO_DISALLOW_COPY_AND_ASSIGN(Connector); 107 MOJO_DISALLOW_COPY_AND_ASSIGN(Connector);
105 }; 108 };
106 109
107 } // namespace internal 110 } // namespace internal
108 } // namespace mojo 111 } // namespace mojo
109 112
110 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ 113 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698