| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 DCHECK(endpoint->peer_closed()); | 343 DCHECK(endpoint->peer_closed()); |
| 344 UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED); | 344 UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED); |
| 345 } else { | 345 } else { |
| 346 UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED); | 346 UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED); |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 | 349 |
| 350 DCHECK(endpoints_.empty()); | 350 DCHECK(endpoints_.empty()); |
| 351 } | 351 } |
| 352 | 352 |
| 353 void MultiplexRouter::SetMasterInterfaceName(const std::string& name) { | 353 void MultiplexRouter::SetMasterInterfaceName(const char* name) { |
| 354 DCHECK(thread_checker_.CalledOnValidThread()); | 354 DCHECK(thread_checker_.CalledOnValidThread()); |
| 355 header_validator_->SetDescription(name + " [master] MessageHeaderValidator"); | 355 header_validator_->SetDescription( |
| 356 std::string(name) + " [master] MessageHeaderValidator"); |
| 356 control_message_handler_.SetDescription( | 357 control_message_handler_.SetDescription( |
| 357 name + " [master] PipeControlMessageHandler"); | 358 std::string(name) + " [master] PipeControlMessageHandler"); |
| 359 connector_.SetWatcherHeapProfilerTag(name); |
| 358 } | 360 } |
| 359 | 361 |
| 360 void MultiplexRouter::CreateEndpointHandlePair( | 362 void MultiplexRouter::CreateEndpointHandlePair( |
| 361 ScopedInterfaceEndpointHandle* local_endpoint, | 363 ScopedInterfaceEndpointHandle* local_endpoint, |
| 362 ScopedInterfaceEndpointHandle* remote_endpoint) { | 364 ScopedInterfaceEndpointHandle* remote_endpoint) { |
| 363 MayAutoLock locker(lock_.get()); | 365 MayAutoLock locker(lock_.get()); |
| 364 uint32_t id = 0; | 366 uint32_t id = 0; |
| 365 do { | 367 do { |
| 366 if (next_interface_id_value_ >= kInterfaceIdNamespaceMask) | 368 if (next_interface_id_value_ >= kInterfaceIdNamespaceMask) |
| 367 next_interface_id_value_ = 1; | 369 next_interface_id_value_ = 1; |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 | 914 |
| 913 void MultiplexRouter::AssertLockAcquired() { | 915 void MultiplexRouter::AssertLockAcquired() { |
| 914 #if DCHECK_IS_ON() | 916 #if DCHECK_IS_ON() |
| 915 if (lock_) | 917 if (lock_) |
| 916 lock_->AssertAcquired(); | 918 lock_->AssertAcquired(); |
| 917 #endif | 919 #endif |
| 918 } | 920 } |
| 919 | 921 |
| 920 } // namespace internal | 922 } // namespace internal |
| 921 } // namespace mojo | 923 } // namespace mojo |
| OLD | NEW |