OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/common/process_watcher.h" | 5 #include "chrome/common/process_watcher.h" |
6 | 6 |
7 #include "base/scoped_ptr.h" | |
8 #include "base/env_var.h" | 7 #include "base/env_var.h" |
9 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
10 #include "base/object_watcher.h" | 9 #include "base/object_watcher.h" |
11 #include "chrome/common/env_vars.h" | 10 #include "chrome/common/env_vars.h" |
12 #include "chrome/common/result_codes.h" | 11 #include "chrome/common/result_codes.h" |
13 | 12 |
14 // Maximum amount of time (in milliseconds) to wait for the process to exit. | 13 // Maximum amount of time (in milliseconds) to wait for the process to exit. |
15 static const int kWaitInterval = 2000; | 14 static const int kWaitInterval = 2000; |
16 | 15 |
17 namespace { | 16 namespace { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // If already signaled, then we are done! | 85 // If already signaled, then we are done! |
87 if (WaitForSingleObject(process, 0) == WAIT_OBJECT_0) { | 86 if (WaitForSingleObject(process, 0) == WAIT_OBJECT_0) { |
88 CloseHandle(process); | 87 CloseHandle(process); |
89 return; | 88 return; |
90 } | 89 } |
91 | 90 |
92 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 91 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
93 new TimerExpiredTask(process), | 92 new TimerExpiredTask(process), |
94 kWaitInterval); | 93 kWaitInterval); |
95 } | 94 } |
OLD | NEW |