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