| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 std::move(runner)), | 306 std::move(runner)), |
| 307 lock_(config == MULTI_INTERFACE ? new base::Lock : nullptr), | 307 lock_(config == MULTI_INTERFACE ? new base::Lock : nullptr), |
| 308 control_message_handler_(this), | 308 control_message_handler_(this), |
| 309 control_message_proxy_(&connector_), | 309 control_message_proxy_(&connector_), |
| 310 next_interface_id_value_(1), | 310 next_interface_id_value_(1), |
| 311 posted_to_process_tasks_(false), | 311 posted_to_process_tasks_(false), |
| 312 encountered_error_(false), | 312 encountered_error_(false), |
| 313 paused_(false), | 313 paused_(false), |
| 314 testing_mode_(false) { | 314 testing_mode_(false) { |
| 315 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 315 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 316 DCHECK(config == SINGLE_INTERFACE || base::ThreadTaskRunnerHandle::IsSet()); | |
| 317 | 316 |
| 318 if (config == SINGLE_INTERFACE_WITH_SYNC_METHODS || | 317 if (config == SINGLE_INTERFACE_WITH_SYNC_METHODS || |
| 319 config == MULTI_INTERFACE) { | 318 config == MULTI_INTERFACE) { |
| 320 // Always participate in sync handle watching in multi-interface mode, | 319 // Always participate in sync handle watching in multi-interface mode, |
| 321 // because even if it doesn't expect sync requests during sync handle | 320 // because even if it doesn't expect sync requests during sync handle |
| 322 // watching, it may still need to dispatch messages to associated endpoints | 321 // watching, it may still need to dispatch messages to associated endpoints |
| 323 // on a different thread. | 322 // on a different thread. |
| 324 connector_.AllowWokenUpBySyncWatchOnSameThread(); | 323 connector_.AllowWokenUpBySyncWatchOnSameThread(); |
| 325 } | 324 } |
| 326 connector_.set_incoming_receiver(&filters_); | 325 connector_.set_incoming_receiver(&filters_); |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 | 936 |
| 938 void MultiplexRouter::AssertLockAcquired() { | 937 void MultiplexRouter::AssertLockAcquired() { |
| 939 #if DCHECK_IS_ON() | 938 #if DCHECK_IS_ON() |
| 940 if (lock_) | 939 if (lock_) |
| 941 lock_->AssertAcquired(); | 940 lock_->AssertAcquired(); |
| 942 #endif | 941 #endif |
| 943 } | 942 } |
| 944 | 943 |
| 945 } // namespace internal | 944 } // namespace internal |
| 946 } // namespace mojo | 945 } // namespace mojo |
| OLD | NEW |