| 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_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 <stdint.h> | 8 #include <stdint.h> |
| 9 #include <algorithm> // For |std::swap()|. | 9 #include <algorithm> // For |std::swap()|. |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 DCHECK(endpoint_client_); | 309 DCHECK(endpoint_client_); |
| 310 return; | 310 return; |
| 311 } | 311 } |
| 312 // The object hasn't been bound. | 312 // The object hasn't been bound. |
| 313 if (!handle_.is_valid()) | 313 if (!handle_.is_valid()) |
| 314 return; | 314 return; |
| 315 | 315 |
| 316 router_ = new MultiplexRouter(true, std::move(handle_)); | 316 router_ = new MultiplexRouter(true, std::move(handle_)); |
| 317 endpoint_client_.reset(new InterfaceEndpointClient( | 317 endpoint_client_.reset(new InterfaceEndpointClient( |
| 318 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr, | 318 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr, |
| 319 make_scoped_ptr(new typename Interface::ResponseValidator_()))); | 319 make_scoped_ptr(new typename Interface::ResponseValidator_()), false)); |
| 320 proxy_.reset(new Proxy(endpoint_client_.get())); | 320 proxy_.reset(new Proxy(endpoint_client_.get())); |
| 321 proxy_->serialization_context()->router = endpoint_client_->router(); | 321 proxy_->serialization_context()->router = endpoint_client_->router(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 scoped_refptr<MultiplexRouter> router_; | 324 scoped_refptr<MultiplexRouter> router_; |
| 325 | 325 |
| 326 scoped_ptr<InterfaceEndpointClient> endpoint_client_; | 326 scoped_ptr<InterfaceEndpointClient> endpoint_client_; |
| 327 scoped_ptr<Proxy> proxy_; | 327 scoped_ptr<Proxy> proxy_; |
| 328 | 328 |
| 329 // |router_| (as well as other members above) is not initialized until | 329 // |router_| (as well as other members above) is not initialized until |
| 330 // read/write with the message pipe handle is needed. |handle_| is valid | 330 // read/write with the message pipe handle is needed. |handle_| is valid |
| 331 // between the Bind() call and the initialization of |router_|. | 331 // between the Bind() call and the initialization of |router_|. |
| 332 ScopedMessagePipeHandle handle_; | 332 ScopedMessagePipeHandle handle_; |
| 333 | 333 |
| 334 uint32_t version_; | 334 uint32_t version_; |
| 335 | 335 |
| 336 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 336 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 } // namespace internal | 339 } // namespace internal |
| 340 } // namespace mojo | 340 } // namespace mojo |
| 341 | 341 |
| 342 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 342 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
| OLD | NEW |