OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |