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

Side by Side Diff: base/process/kill_win.cc

Issue 1543293004: Switch to standard integer types in base/process/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ssize_t Created 5 years 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
« no previous file with comments | « base/process/kill_posix.cc ('k') | base/process/launch.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/kill.h" 5 #include "base/process/kill.h"
6 6
7 #include <windows.h>
7 #include <io.h> 8 #include <io.h>
8 #include <windows.h> 9 #include <stdint.h>
9 10
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/macros.h"
13 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
14 #include "base/process/process_iterator.h" 16 #include "base/process/process_iterator.h"
15 #include "base/win/object_watcher.h" 17 #include "base/win/object_watcher.h"
16 18
17 namespace base { 19 namespace base {
18 20
19 namespace { 21 namespace {
20 22
21 // Exit codes with special meanings on Windows. 23 // Exit codes with special meanings on Windows.
22 const DWORD kNormalTerminationExitCode = 0; 24 const DWORD kNormalTerminationExitCode = 0;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 151
150 bool WaitForProcessesToExit(const FilePath::StringType& executable_name, 152 bool WaitForProcessesToExit(const FilePath::StringType& executable_name,
151 TimeDelta wait, 153 TimeDelta wait,
152 const ProcessFilter* filter) { 154 const ProcessFilter* filter) {
153 bool result = true; 155 bool result = true;
154 DWORD start_time = GetTickCount(); 156 DWORD start_time = GetTickCount();
155 157
156 NamedProcessIterator iter(executable_name, filter); 158 NamedProcessIterator iter(executable_name, filter);
157 for (const ProcessEntry* entry = iter.NextProcessEntry(); entry; 159 for (const ProcessEntry* entry = iter.NextProcessEntry(); entry;
158 entry = iter.NextProcessEntry()) { 160 entry = iter.NextProcessEntry()) {
159 DWORD remaining_wait = static_cast<DWORD>(std::max( 161 DWORD remaining_wait = static_cast<DWORD>(
160 static_cast<int64>(0), 162 std::max(static_cast<int64_t>(0),
161 wait.InMilliseconds() - (GetTickCount() - start_time))); 163 wait.InMilliseconds() - (GetTickCount() - start_time)));
162 HANDLE process = OpenProcess(SYNCHRONIZE, 164 HANDLE process = OpenProcess(SYNCHRONIZE,
163 FALSE, 165 FALSE,
164 entry->th32ProcessID); 166 entry->th32ProcessID);
165 DWORD wait_result = WaitForSingleObject(process, remaining_wait); 167 DWORD wait_result = WaitForSingleObject(process, remaining_wait);
166 CloseHandle(process); 168 CloseHandle(process);
167 result &= (wait_result == WAIT_OBJECT_0); 169 result &= (wait_result == WAIT_OBJECT_0);
168 } 170 }
169 171
170 return result; 172 return result;
171 } 173 }
(...skipping 17 matching lines...) Expand all
189 } 191 }
190 192
191 MessageLoop::current()->PostDelayedTask( 193 MessageLoop::current()->PostDelayedTask(
192 FROM_HERE, 194 FROM_HERE,
193 Bind(&TimerExpiredTask::TimedOut, 195 Bind(&TimerExpiredTask::TimedOut,
194 Owned(new TimerExpiredTask(process.Pass()))), 196 Owned(new TimerExpiredTask(process.Pass()))),
195 TimeDelta::FromMilliseconds(kWaitInterval)); 197 TimeDelta::FromMilliseconds(kWaitInterval));
196 } 198 }
197 199
198 } // namespace base 200 } // namespace base
OLDNEW
« no previous file with comments | « base/process/kill_posix.cc ('k') | base/process/launch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698