| 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/edk/system/master_connection_manager.h" | 5 #include "mojo/edk/system/master_connection_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 DCHECK(connections_.find(peer_process_identifier) != connections_.end()); | 625 DCHECK(connections_.find(peer_process_identifier) != connections_.end()); |
| 626 switch (process_connections->GetConnectionStatus(peer_process_identifier, | 626 switch (process_connections->GetConnectionStatus(peer_process_identifier, |
| 627 platform_handle)) { | 627 platform_handle)) { |
| 628 case ProcessConnections::ConnectionStatus::NONE: { | 628 case ProcessConnections::ConnectionStatus::NONE: { |
| 629 // TODO(vtl): In the "second connect" case, this should never be reached | 629 // TODO(vtl): In the "second connect" case, this should never be reached |
| 630 // (but it's not easy to DCHECK this invariant here). | 630 // (but it's not easy to DCHECK this invariant here). |
| 631 process_connections->AddConnection( | 631 process_connections->AddConnection( |
| 632 peer_process_identifier, | 632 peer_process_identifier, |
| 633 ProcessConnections::ConnectionStatus::RUNNING, | 633 ProcessConnections::ConnectionStatus::RUNNING, |
| 634 ScopedPlatformHandle()); | 634 ScopedPlatformHandle()); |
| 635 PlatformPipe platform_channel_pair; | 635 PlatformPipe platform_pipe; |
| 636 *platform_handle = platform_channel_pair.handle0.Pass(); | 636 *platform_handle = platform_pipe.handle0.Pass(); |
| 637 | 637 |
| 638 connections_[peer_process_identifier]->AddConnection( | 638 connections_[peer_process_identifier]->AddConnection( |
| 639 process_identifier, ProcessConnections::ConnectionStatus::PENDING, | 639 process_identifier, ProcessConnections::ConnectionStatus::PENDING, |
| 640 platform_channel_pair.handle1.Pass()); | 640 platform_pipe.handle1.Pass()); |
| 641 break; | 641 break; |
| 642 } | 642 } |
| 643 case ProcessConnections::ConnectionStatus::PENDING: | 643 case ProcessConnections::ConnectionStatus::PENDING: |
| 644 DCHECK(connections_[peer_process_identifier]->GetConnectionStatus( | 644 DCHECK(connections_[peer_process_identifier]->GetConnectionStatus( |
| 645 process_identifier, nullptr) == | 645 process_identifier, nullptr) == |
| 646 ProcessConnections::ConnectionStatus::RUNNING); | 646 ProcessConnections::ConnectionStatus::RUNNING); |
| 647 break; | 647 break; |
| 648 case ProcessConnections::ConnectionStatus::RUNNING: | 648 case ProcessConnections::ConnectionStatus::RUNNING: |
| 649 // |process_identifier| already has a connection to | 649 // |process_identifier| already has a connection to |
| 650 // |peer_process_identifier|, so it should reuse that. | 650 // |peer_process_identifier|, so it should reuse that. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 DCHECK(!private_thread_task_runner_->RunsTasksOnCurrentThread()); | 751 DCHECK(!private_thread_task_runner_->RunsTasksOnCurrentThread()); |
| 752 } | 752 } |
| 753 | 753 |
| 754 void MasterConnectionManager::AssertOnPrivateThread() const { | 754 void MasterConnectionManager::AssertOnPrivateThread() const { |
| 755 // This should only be called after |Init()| and before |Shutdown()|. | 755 // This should only be called after |Init()| and before |Shutdown()|. |
| 756 DCHECK(private_thread_task_runner_->RunsTasksOnCurrentThread()); | 756 DCHECK(private_thread_task_runner_->RunsTasksOnCurrentThread()); |
| 757 } | 757 } |
| 758 | 758 |
| 759 } // namespace system | 759 } // namespace system |
| 760 } // namespace mojo | 760 } // namespace mojo |
| OLD | NEW |