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

Side by Side Diff: mojo/public/cpp/bindings/binding.h

Issue 739493002: Introduce command buffer control thread (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Route echo better Created 6 years, 1 month 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
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/strong_binding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_BINDING_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_BINDING_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/error_handler.h" 9 #include "mojo/public/cpp/bindings/error_handler.h"
10 #include "mojo/public/cpp/bindings/interface_ptr.h" 10 #include "mojo/public/cpp/bindings/interface_ptr.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 // ErrorHandler implementation 117 // ErrorHandler implementation
118 void OnConnectionError() override { 118 void OnConnectionError() override {
119 if (error_handler_) 119 if (error_handler_)
120 error_handler_->OnConnectionError(); 120 error_handler_->OnConnectionError();
121 } 121 }
122 122
123 Interface* impl() { return impl_; } 123 Interface* impl() { return impl_; }
124 Client* client() { return proxy_; } 124 Client* client() { return proxy_; }
125
126 bool is_bound() const { return !!internal_router_; }
127
125 // Exposed for testing, should not generally be used. 128 // Exposed for testing, should not generally be used.
126 internal::Router* internal_router() { return internal_router_; } 129 internal::Router* internal_router() { return internal_router_; }
127 130
128 private: 131 private:
129 internal::Router* internal_router_ = nullptr; 132 internal::Router* internal_router_ = nullptr;
130 typename Client::Proxy_* proxy_ = nullptr; 133 typename Client::Proxy_* proxy_ = nullptr;
131 typename Interface::Stub_ stub_; 134 typename Interface::Stub_ stub_;
132 Interface* impl_; 135 Interface* impl_;
133 ErrorHandler* error_handler_ = nullptr; 136 ErrorHandler* error_handler_ = nullptr;
134 137
135 MOJO_DISALLOW_COPY_AND_ASSIGN(Binding); 138 MOJO_DISALLOW_COPY_AND_ASSIGN(Binding);
136 }; 139 };
137 140
138 } // namespace mojo 141 } // namespace mojo
139 142
140 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ 143 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/strong_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698