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

Side by Side Diff: base/process_util_win.cc

Issue 9200009: windows: Fix a few things clang complains about. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 | « base/file_util_win.cc ('k') | base/win/sampling_profiler.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <fcntl.h> 7 #include <fcntl.h>
8 #include <io.h> 8 #include <io.h>
9 #include <windows.h> 9 #include <windows.h>
10 #include <userenv.h> 10 #include <userenv.h>
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 } 585 }
586 586
587 bool WaitForProcessesToExit(const std::wstring& executable_name, 587 bool WaitForProcessesToExit(const std::wstring& executable_name,
588 int64 wait_milliseconds, 588 int64 wait_milliseconds,
589 const ProcessFilter* filter) { 589 const ProcessFilter* filter) {
590 const ProcessEntry* entry; 590 const ProcessEntry* entry;
591 bool result = true; 591 bool result = true;
592 DWORD start_time = GetTickCount(); 592 DWORD start_time = GetTickCount();
593 593
594 NamedProcessIterator iter(executable_name, filter); 594 NamedProcessIterator iter(executable_name, filter);
595 while (entry = iter.NextProcessEntry()) { 595 while ((entry = iter.NextProcessEntry()) != NULL) {
596 DWORD remaining_wait = 596 DWORD remaining_wait =
597 std::max<int64>(0, wait_milliseconds - (GetTickCount() - start_time)); 597 std::max<int64>(0, wait_milliseconds - (GetTickCount() - start_time));
598 HANDLE process = OpenProcess(SYNCHRONIZE, 598 HANDLE process = OpenProcess(SYNCHRONIZE,
599 FALSE, 599 FALSE,
600 entry->th32ProcessID); 600 entry->th32ProcessID);
601 DWORD wait_result = WaitForSingleObject(process, remaining_wait); 601 DWORD wait_result = WaitForSingleObject(process, remaining_wait);
602 CloseHandle(process); 602 CloseHandle(process);
603 result = result && (wait_result == WAIT_OBJECT_0); 603 result = result && (wait_result == WAIT_OBJECT_0);
604 } 604 }
605 605
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 PERFORMANCE_INFORMATION info; 991 PERFORMANCE_INFORMATION info;
992 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { 992 if (!InternalGetPerformanceInfo(&info, sizeof(info))) {
993 DLOG(ERROR) << "Failed to fetch internal performance info."; 993 DLOG(ERROR) << "Failed to fetch internal performance info.";
994 return 0; 994 return 0;
995 } 995 }
996 return (info.CommitTotal * system_info.dwPageSize) / 1024; 996 return (info.CommitTotal * system_info.dwPageSize) / 1024;
997 } 997 }
998 998
999 } // namespace base 999 } // namespace base
OLDNEW
« no previous file with comments | « base/file_util_win.cc ('k') | base/win/sampling_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698