Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: third_party/mojo/src/mojo/edk/system/ipc_support.cc

Issue 1311613002: Revert of Update mojo sdk to rev c02a28868825edfa57ab77947b8cb15e741c5598 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ipc_support.h" 5 #include "mojo/edk/system/ipc_support.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/edk/embedder/master_process_delegate.h" 8 #include "mojo/edk/embedder/master_process_delegate.h"
9 #include "mojo/edk/embedder/slave_process_delegate.h" 9 #include "mojo/edk/embedder/slave_process_delegate.h"
10 #include "mojo/edk/system/channel_manager.h" 10 #include "mojo/edk/system/channel_manager.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 DCHECK(slave_process_identifier); 134 DCHECK(slave_process_identifier);
135 DCHECK_EQ(process_type_, embedder::ProcessType::MASTER); 135 DCHECK_EQ(process_type_, embedder::ProcessType::MASTER);
136 136
137 *slave_process_identifier = 137 *slave_process_identifier =
138 static_cast<system::MasterConnectionManager*>(connection_manager()) 138 static_cast<system::MasterConnectionManager*>(connection_manager())
139 ->AddSlaveAndBootstrap(slave_info, platform_handle.Pass(), 139 ->AddSlaveAndBootstrap(slave_info, platform_handle.Pass(),
140 connection_id); 140 connection_id);
141 141
142 system::ProcessIdentifier peer_id = system::kInvalidProcessIdentifier; 142 system::ProcessIdentifier peer_id = system::kInvalidProcessIdentifier;
143 embedder::ScopedPlatformHandle platform_connection_handle; 143 embedder::ScopedPlatformHandle platform_connection_handle;
144 CHECK_EQ(connection_manager()->Connect(connection_id, &peer_id, 144 CHECK(connection_manager()->Connect(connection_id, &peer_id,
145 &platform_connection_handle), 145 &platform_connection_handle));
146 ConnectionManager::Result::SUCCESS_CONNECT_NEW_CONNECTION);
147 DCHECK_EQ(peer_id, *slave_process_identifier); 146 DCHECK_EQ(peer_id, *slave_process_identifier);
148 DCHECK(platform_connection_handle.is_valid()); 147 DCHECK(platform_connection_handle.is_valid());
149 return platform_connection_handle; 148 return platform_connection_handle;
150 } 149 }
151 150
152 embedder::ScopedPlatformHandle IPCSupport::ConnectToMasterInternal( 151 embedder::ScopedPlatformHandle IPCSupport::ConnectToMasterInternal(
153 const ConnectionIdentifier& connection_id) { 152 const ConnectionIdentifier& connection_id) {
154 DCHECK_EQ(process_type_, embedder::ProcessType::SLAVE); 153 DCHECK_EQ(process_type_, embedder::ProcessType::SLAVE);
155 154
156 system::ProcessIdentifier peer_id; 155 system::ProcessIdentifier peer_id;
157 embedder::ScopedPlatformHandle platform_connection_handle; 156 embedder::ScopedPlatformHandle platform_connection_handle;
158 CHECK_EQ(connection_manager()->Connect(connection_id, &peer_id, 157 CHECK(connection_manager()->Connect(connection_id, &peer_id,
159 &platform_connection_handle), 158 &platform_connection_handle));
160 ConnectionManager::Result::SUCCESS_CONNECT_NEW_CONNECTION);
161 DCHECK_EQ(peer_id, system::kMasterProcessIdentifier); 159 DCHECK_EQ(peer_id, system::kMasterProcessIdentifier);
162 DCHECK(platform_connection_handle.is_valid()); 160 DCHECK(platform_connection_handle.is_valid());
163 return platform_connection_handle; 161 return platform_connection_handle;
164 } 162 }
165 163
166 } // namespace system 164 } // namespace system
167 } // namespace mojo 165 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698