| OLD | NEW |
| 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 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" | 5 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 DCHECK(endpoint->peer_closed()); | 354 DCHECK(endpoint->peer_closed()); |
| 355 UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED); | 355 UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED); |
| 356 } else { | 356 } else { |
| 357 UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED); | 357 UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 DCHECK(endpoints_.empty()); | 361 DCHECK(endpoints_.empty()); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void MultiplexRouter::SetMasterInterfaceName(const std::string& name) { | 364 void MultiplexRouter::SetMasterInterfaceName(const char* name) { |
| 365 DCHECK(thread_checker_.CalledOnValidThread()); | 365 DCHECK(thread_checker_.CalledOnValidThread()); |
| 366 header_validator_->SetDescription(name + " [master] MessageHeaderValidator"); | 366 header_validator_->SetDescription( |
| 367 std::string(name) + " [master] MessageHeaderValidator"); |
| 367 control_message_handler_.SetDescription( | 368 control_message_handler_.SetDescription( |
| 368 name + " [master] PipeControlMessageHandler"); | 369 std::string(name) + " [master] PipeControlMessageHandler"); |
| 370 connector_.SetWatcherHeapProfilerTag(name); |
| 369 } | 371 } |
| 370 | 372 |
| 371 void MultiplexRouter::CreateEndpointHandlePair( | 373 void MultiplexRouter::CreateEndpointHandlePair( |
| 372 ScopedInterfaceEndpointHandle* local_endpoint, | 374 ScopedInterfaceEndpointHandle* local_endpoint, |
| 373 ScopedInterfaceEndpointHandle* remote_endpoint) { | 375 ScopedInterfaceEndpointHandle* remote_endpoint) { |
| 374 MayAutoLock locker(lock_.get()); | 376 MayAutoLock locker(lock_.get()); |
| 375 uint32_t id = 0; | 377 uint32_t id = 0; |
| 376 do { | 378 do { |
| 377 if (next_interface_id_value_ >= kInterfaceIdNamespaceMask) | 379 if (next_interface_id_value_ >= kInterfaceIdNamespaceMask) |
| 378 next_interface_id_value_ = 1; | 380 next_interface_id_value_ = 1; |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 | 935 |
| 934 void MultiplexRouter::AssertLockAcquired() { | 936 void MultiplexRouter::AssertLockAcquired() { |
| 935 #if DCHECK_IS_ON() | 937 #if DCHECK_IS_ON() |
| 936 if (lock_) | 938 if (lock_) |
| 937 lock_->AssertAcquired(); | 939 lock_->AssertAcquired(); |
| 938 #endif | 940 #endif |
| 939 } | 941 } |
| 940 | 942 |
| 941 } // namespace internal | 943 } // namespace internal |
| 942 } // namespace mojo | 944 } // namespace mojo |
| OLD | NEW |