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

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

Issue 1475813002: Mojo C++ bindings: support passing associated interface pointers/requests in method parameter lists… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@25_use_multiplex_router
Patch Set: Created 5 years 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 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_STATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
7 7
8 #include <algorithm> // For |std::swap()|. 8 #include <algorithm> // For |std::swap()|.
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // The object hasn't been bound. 313 // The object hasn't been bound.
314 if (!waiter_) { 314 if (!waiter_) {
315 DCHECK(!handle_.is_valid()); 315 DCHECK(!handle_.is_valid());
316 return; 316 return;
317 } 317 }
318 318
319 router_ = new MultiplexRouter(true, handle_.Pass(), waiter_); 319 router_ = new MultiplexRouter(true, handle_.Pass(), waiter_);
320 endpoint_client_.reset(new InterfaceEndpointClient( 320 endpoint_client_.reset(new InterfaceEndpointClient(
321 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr, 321 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr,
322 make_scoped_ptr(new typename Interface::ResponseValidator_()))); 322 make_scoped_ptr(new typename Interface::ResponseValidator_())));
323 proxy_.reset(new Proxy(endpoint_client_.get(), endpoint_client_->router())); 323 proxy_.reset(new Proxy(endpoint_client_.get()));
324 proxy_->serialization_context()->router = endpoint_client_->router();
324 325
325 waiter_ = nullptr; 326 waiter_ = nullptr;
326 } 327 }
327 328
328 scoped_refptr<MultiplexRouter> router_; 329 scoped_refptr<MultiplexRouter> router_;
329 330
330 scoped_ptr<InterfaceEndpointClient> endpoint_client_; 331 scoped_ptr<InterfaceEndpointClient> endpoint_client_;
331 scoped_ptr<Proxy> proxy_; 332 scoped_ptr<Proxy> proxy_;
332 333
333 // |router_| (as well as other members above) is not initialized until 334 // |router_| (as well as other members above) is not initialized until
334 // read/write with the message pipe handle is needed. |handle_| and |waiter_| 335 // read/write with the message pipe handle is needed. |handle_| and |waiter_|
335 // are valid between the Bind() call and the initialization of |router_|. 336 // are valid between the Bind() call and the initialization of |router_|.
336 ScopedMessagePipeHandle handle_; 337 ScopedMessagePipeHandle handle_;
337 const MojoAsyncWaiter* waiter_; 338 const MojoAsyncWaiter* waiter_;
338 339
339 uint32_t version_; 340 uint32_t version_;
340 341
341 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); 342 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
342 }; 343 };
343 344
344 } // namespace internal 345 } // namespace internal
345 } // namespace mojo 346 } // namespace mojo
346 347
347 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ 348 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/control_message_proxy.cc ('k') | mojo/public/cpp/bindings/lib/map_serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698