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

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

Issue 1823683006: Mojo C++ bindings: sync call support for associated interfaces and master interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_BINDING_STATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 void Bind(ScopedMessagePipeHandle handle) { 144 void Bind(ScopedMessagePipeHandle handle) {
145 DCHECK(!router_); 145 DCHECK(!router_);
146 146
147 router_ = new internal::MultiplexRouter(false, std::move(handle)); 147 router_ = new internal::MultiplexRouter(false, std::move(handle));
148 stub_.serialization_context()->router = router_; 148 stub_.serialization_context()->router = router_;
149 149
150 endpoint_client_.reset(new internal::InterfaceEndpointClient( 150 endpoint_client_.reset(new internal::InterfaceEndpointClient(
151 router_->CreateLocalEndpointHandle(internal::kMasterInterfaceId), 151 router_->CreateLocalEndpointHandle(internal::kMasterInterfaceId),
152 &stub_, make_scoped_ptr(new typename Interface::RequestValidator_()))); 152 &stub_, make_scoped_ptr(new typename Interface::RequestValidator_()),
153 Interface::HasSyncMethods_));
153 154
154 endpoint_client_->set_connection_error_handler( 155 endpoint_client_->set_connection_error_handler(
155 [this]() { connection_error_handler_.Run(); }); 156 [this]() { connection_error_handler_.Run(); });
156 } 157 }
157 158
158 bool HasAssociatedInterfaces() const { 159 bool HasAssociatedInterfaces() const {
159 return router_ ? router_->HasAssociatedEndpoints() : false; 160 return router_ ? router_->HasAssociatedEndpoints() : false;
160 } 161 }
161 162
162 void PauseIncomingMethodCallProcessing() { 163 void PauseIncomingMethodCallProcessing() {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 Interface* impl_; 223 Interface* impl_;
223 Closure connection_error_handler_; 224 Closure connection_error_handler_;
224 225
225 DISALLOW_COPY_AND_ASSIGN(BindingState); 226 DISALLOW_COPY_AND_ASSIGN(BindingState);
226 }; 227 };
227 228
228 } // namesapce internal 229 } // namesapce internal
229 } // namespace mojo 230 } // namespace mojo
230 231
231 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ 232 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h ('k') | mojo/public/cpp/bindings/lib/connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698