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

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

Issue 938453002: Remove base::WaitForSingleProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format :( Created 5 years, 10 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // Spawn child and set up sync IPC connection. 144 // Spawn child and set up sync IPC connection.
145 child_process_ = LaunchNSSDecrypterChildProcess(nss_path, channel_.get()); 145 child_process_ = LaunchNSSDecrypterChildProcess(nss_path, channel_.get());
146 return child_process_.IsValid(); 146 return child_process_.IsValid();
147 } 147 }
148 148
149 FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() { 149 FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() {
150 listener_->QuitClient(); 150 listener_->QuitClient();
151 channel_->Close(); 151 channel_->Close();
152 152
153 if (child_process_.IsValid()) { 153 if (child_process_.IsValid()) {
154 base::WaitForSingleProcess(child_process_.Handle(), 154 int exit_code;
155 base::TimeDelta::FromSeconds(5)); 155 child_process_.WaitForExitWithTimeout(base::TimeDelta::FromSeconds(5),
156 child_process_.Close(); 156 &exit_code);
157 } 157 }
158 } 158 }
159 159
160 // A message_loop task that quits the message loop when invoked, setting cancel 160 // A message_loop task that quits the message loop when invoked, setting cancel
161 // causes the task to do nothing when invoked. 161 // causes the task to do nothing when invoked.
162 class CancellableQuitMsgLoop : public base::RefCounted<CancellableQuitMsgLoop> { 162 class CancellableQuitMsgLoop : public base::RefCounted<CancellableQuitMsgLoop> {
163 public: 163 public:
164 CancellableQuitMsgLoop() : cancelled_(false) {} 164 CancellableQuitMsgLoop() : cancelled_(false) {}
165 void QuitNow() { 165 void QuitNow() {
166 if (!cancelled_) 166 if (!cancelled_)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient( 287 scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient(
288 kTestChannelID, &listener); 288 kTestChannelID, &listener);
289 CHECK(channel->Connect()); 289 CHECK(channel->Connect());
290 listener.SetSender(channel.get()); 290 listener.SetSender(channel.get());
291 291
292 // run message loop 292 // run message loop
293 base::MessageLoop::current()->Run(); 293 base::MessageLoop::current()->Run();
294 294
295 return 0; 295 return 0;
296 } 296 }
OLDNEW
« no previous file with comments | « chrome/browser/service_process/service_process_control_browsertest.cc ('k') | ipc/ipc_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698