OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_INTERFACE_PTR_INTERNAL_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ |
7 | 7 |
8 #include <assert.h> | 8 #include <assert.h> |
9 | 9 |
10 #include "mojo/public/cpp/bindings/lib/filter_chain.h" | 10 #include "mojo/public/cpp/bindings/lib/filter_chain.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 ScopedMessagePipeHandle PassMessagePipe() { | 63 ScopedMessagePipeHandle PassMessagePipe() { |
64 if (router_) | 64 if (router_) |
65 return router_->PassMessagePipe(); | 65 return router_->PassMessagePipe(); |
66 | 66 |
67 waiter_ = NULL; | 67 waiter_ = NULL; |
68 return handle_.Pass(); | 68 return handle_.Pass(); |
69 } | 69 } |
70 | 70 |
| 71 bool is_bound() const { |
| 72 return handle_.is_valid() || router_; |
| 73 } |
| 74 |
71 void set_client(typename Interface::Client* client) { | 75 void set_client(typename Interface::Client* client) { |
72 ConfigureProxyIfNecessary(); | 76 ConfigureProxyIfNecessary(); |
73 | 77 |
74 assert(proxy_); | 78 assert(proxy_); |
75 proxy_->stub.set_sink(client); | 79 proxy_->stub.set_sink(client); |
76 } | 80 } |
77 | 81 |
78 bool encountered_error() const { | 82 bool encountered_error() const { |
79 return router_ ? router_->encountered_error() : false; | 83 return router_ ? router_->encountered_error() : false; |
80 } | 84 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ScopedMessagePipeHandle handle_; | 141 ScopedMessagePipeHandle handle_; |
138 const MojoAsyncWaiter* waiter_; | 142 const MojoAsyncWaiter* waiter_; |
139 | 143 |
140 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 144 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
141 }; | 145 }; |
142 | 146 |
143 } // namespace internal | 147 } // namespace internal |
144 } // namespace mojo | 148 } // namespace mojo |
145 | 149 |
146 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ | 150 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ |
OLD | NEW |