| 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/cpp/bindings/lib/message_queue.h" | 8 #include "mojo/public/cpp/bindings/lib/message_queue.h" |
| 9 #include "mojo/public/cpp/bindings/message.h" | 9 #include "mojo/public/cpp/bindings/message.h" |
| 10 #include "mojo/public/cpp/environment/default_async_waiter.h" | 10 #include "mojo/public/cpp/environment/default_async_waiter.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // Closes the pipe, triggering the error state. Connector is put into a | 56 // Closes the pipe, triggering the error state. Connector is put into a |
| 57 // quiescent state. | 57 // quiescent state. |
| 58 void CloseMessagePipe(); | 58 void CloseMessagePipe(); |
| 59 | 59 |
| 60 // Releases the pipe, not triggering the error state. Connector is put into | 60 // Releases the pipe, not triggering the error state. Connector is put into |
| 61 // a quiescent state. | 61 // a quiescent state. |
| 62 ScopedMessagePipeHandle ReleaseMessagePipe(); | 62 ScopedMessagePipeHandle ReleaseMessagePipe(); |
| 63 | 63 |
| 64 // MessageReceiver implementation: | 64 // MessageReceiver implementation: |
| 65 virtual bool Accept(Message* message) MOJO_OVERRIDE; | 65 virtual bool Accept(Message* message) MOJO_OVERRIDE; |
| 66 virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder) | |
| 67 MOJO_OVERRIDE; | |
| 68 | 66 |
| 69 private: | 67 private: |
| 70 static void CallOnHandleReady(void* closure, MojoResult result); | 68 static void CallOnHandleReady(void* closure, MojoResult result); |
| 71 void OnHandleReady(MojoResult result); | 69 void OnHandleReady(MojoResult result); |
| 72 | 70 |
| 73 void WaitToReadMore(); | 71 void WaitToReadMore(); |
| 74 void ReadMore(); | 72 void ReadMore(); |
| 75 | 73 |
| 76 ErrorHandler* error_handler_; | 74 ErrorHandler* error_handler_; |
| 77 MojoAsyncWaiter* waiter_; | 75 MojoAsyncWaiter* waiter_; |
| 78 | 76 |
| 79 ScopedMessagePipeHandle message_pipe_; | 77 ScopedMessagePipeHandle message_pipe_; |
| 80 MessageReceiver* incoming_receiver_; | 78 MessageReceiver* incoming_receiver_; |
| 81 | 79 |
| 82 MojoAsyncWaitID async_wait_id_; | 80 MojoAsyncWaitID async_wait_id_; |
| 83 bool error_; | 81 bool error_; |
| 84 bool drop_writes_; | 82 bool drop_writes_; |
| 85 bool enforce_errors_from_incoming_receiver_; | 83 bool enforce_errors_from_incoming_receiver_; |
| 86 | 84 |
| 87 MOJO_DISALLOW_COPY_AND_ASSIGN(Connector); | 85 MOJO_DISALLOW_COPY_AND_ASSIGN(Connector); |
| 88 }; | 86 }; |
| 89 | 87 |
| 90 } // namespace internal | 88 } // namespace internal |
| 91 } // namespace mojo | 89 } // namespace mojo |
| 92 | 90 |
| 93 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ | 91 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ |
| OLD | NEW |