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

Side by Side Diff: base/process_util_win.cc

Issue 39282: Start the crash_service on windows when running ui tests, if it's not running... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/ui/ui_test_suite.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/process_util.h" 5 #include "base/process_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <winternl.h> 8 #include <winternl.h>
9 #include <psapi.h> 9 #include <psapi.h>
10 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 CloseHandle(process); 171 CloseHandle(process);
172 return ret; 172 return ret;
173 } 173 }
174 174
175 bool KillProcess(ProcessHandle process, int exit_code, bool wait) { 175 bool KillProcess(ProcessHandle process, int exit_code, bool wait) {
176 bool result = (TerminateProcess(process, exit_code) != FALSE); 176 bool result = (TerminateProcess(process, exit_code) != FALSE);
177 if (result && wait) { 177 if (result && wait) {
178 // The process may not end immediately due to pending I/O 178 // The process may not end immediately due to pending I/O
179 if (WAIT_OBJECT_0 != WaitForSingleObject(process, 60 * 1000)) 179 if (WAIT_OBJECT_0 != WaitForSingleObject(process, 60 * 1000))
180 DLOG(ERROR) << "Error waiting for process exit: " << GetLastError(); 180 DLOG(ERROR) << "Error waiting for process exit: " << GetLastError();
181 } else { 181 } else if (!result) {
182 DLOG(ERROR) << "Unable to terminate process: " << GetLastError(); 182 DLOG(ERROR) << "Unable to terminate process: " << GetLastError();
183 } 183 }
184 return result; 184 return result;
185 } 185 }
186 186
187 bool DidProcessCrash(ProcessHandle handle) { 187 bool DidProcessCrash(ProcessHandle handle) {
188 DWORD exitcode = 0; 188 DWORD exitcode = 0;
189 if (!::GetExitCodeProcess(handle, &exitcode)) { 189 if (!::GetExitCodeProcess(handle, &exitcode)) {
190 NOTREACHED(); 190 NOTREACHED();
191 return false; 191 return false;
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 void EnableTerminationOnHeapCorruption() { 642 void EnableTerminationOnHeapCorruption() {
643 // Ignore the result code. Supported on XP SP3 and Vista. 643 // Ignore the result code. Supported on XP SP3 and Vista.
644 HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); 644 HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
645 } 645 }
646 646
647 void RaiseProcessToHighPriority() { 647 void RaiseProcessToHighPriority() {
648 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); 648 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
649 } 649 }
650 650
651 } // namespace base 651 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/test/ui/ui_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698