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

Side by Side Diff: chrome/utility/importer/firefox_importer_unittest_utils_mac.cc

Issue 2738853002: Connections now take a ConnectionParams instead of a pipe handle. (Closed)
Patch Set: Fix Win compile Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/utility/importer/firefox_importer_unittest_utils.h" 5 #include "chrome/utility/importer/firefox_importer_unittest_utils.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 mojo::ScopedMessagePipeHandle parent_pipe = process.CreateMessagePipe(&token); 152 mojo::ScopedMessagePipeHandle parent_pipe = process.CreateMessagePipe(&token);
153 channel_ = IPC::Channel::CreateServer(parent_pipe.release(), listener_.get()); 153 channel_ = IPC::Channel::CreateServer(parent_pipe.release(), listener_.get());
154 CHECK(channel_->Connect()); 154 CHECK(channel_->Connect());
155 listener_->SetSender(channel_.get()); 155 listener_->SetSender(channel_.get());
156 156
157 // Spawn child and set up sync IPC connection. 157 // Spawn child and set up sync IPC connection.
158 mojo::edk::PlatformChannelPair channel_pair; 158 mojo::edk::PlatformChannelPair channel_pair;
159 child_process_ = LaunchNSSDecrypterChildProcess( 159 child_process_ = LaunchNSSDecrypterChildProcess(
160 nss_path, channel_pair.PassClientHandle(), token); 160 nss_path, channel_pair.PassClientHandle(), token);
161 if (child_process_.IsValid()) 161 if (child_process_.IsValid())
162 process.Connect(child_process_.Handle(), channel_pair.PassServerHandle()); 162 process.Connect(
163 child_process_.Handle(),
164 mojo::edk::ConnectionParam(channel_pair.PassServerHandle()));
163 return child_process_.IsValid(); 165 return child_process_.IsValid();
164 } 166 }
165 167
166 FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() { 168 FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() {
167 listener_->QuitClient(); 169 listener_->QuitClient();
168 channel_->Close(); 170 channel_->Close();
169 171
170 if (child_process_.IsValid()) { 172 if (child_process_.IsValid()) {
171 int exit_code; 173 int exit_code;
172 child_process_.WaitForExitWithTimeout(base::TimeDelta::FromSeconds(5), 174 child_process_.WaitForExitWithTimeout(base::TimeDelta::FromSeconds(5),
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 std::unique_ptr<IPC::Channel> channel = 290 std::unique_ptr<IPC::Channel> channel =
289 IPC::Channel::CreateClient(mojo_handle.release(), &listener); 291 IPC::Channel::CreateClient(mojo_handle.release(), &listener);
290 CHECK(channel->Connect()); 292 CHECK(channel->Connect());
291 listener.SetSender(channel.get()); 293 listener.SetSender(channel.get());
292 294
293 // run message loop 295 // run message loop
294 base::RunLoop().Run(); 296 base::RunLoop().Run();
295 297
296 return 0; 298 return 0;
297 } 299 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698