OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <atlctl.h> | 7 #include <atlctl.h> |
8 #include <initguid.h> | 8 #include <initguid.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // This is the normal case. Chrome exits and windows marks the mutex as | 103 // This is the normal case. Chrome exits and windows marks the mutex as |
104 // abandoned. | 104 // abandoned. |
105 } else if (result == WAIT_OBJECT_0) { | 105 } else if (result == WAIT_OBJECT_0) { |
106 // This is unexpected. Check if somebody is not closing the mutex on | 106 // This is unexpected. Check if somebody is not closing the mutex on |
107 // RelaunchChromehelper, the mutex should not be closed. | 107 // RelaunchChromehelper, the mutex should not be closed. |
108 AtlTrace("Unexpected release of the relaunch mutex!!\n"); | 108 AtlTrace("Unexpected release of the relaunch mutex!!\n"); |
109 } else if (result == WAIT_TIMEOUT) { | 109 } else if (result == WAIT_TIMEOUT) { |
110 // This could mean that Chrome is hung. Proceed to exterminate. | 110 // This could mean that Chrome is hung. Proceed to exterminate. |
111 base::Process process = operation.GetParent(); | 111 base::Process process = operation.GetParent(); |
112 AtlTrace("%ds timeout. Killing Chrome %d\n", kWaitSeconds, process.Pid()); | 112 AtlTrace("%ds timeout. Killing Chrome %d\n", kWaitSeconds, process.Pid()); |
113 process.Terminate(0); | 113 process.Terminate(0, false); |
114 } else { | 114 } else { |
115 AtlTrace("Failed to wait for relaunch mutex, result is 0x%x\n", result); | 115 AtlTrace("Failed to wait for relaunch mutex, result is 0x%x\n", result); |
116 } | 116 } |
117 } else { | 117 } else { |
118 // It is possible that chrome exits so fast that the mutex is not there. | 118 // It is possible that chrome exits so fast that the mutex is not there. |
119 AtlTrace("No relaunch mutex found\n"); | 119 AtlTrace("No relaunch mutex found\n"); |
120 } | 120 } |
121 | 121 |
122 // On Windows 8+ to launch Chrome we rely on Windows to use the | 122 // On Windows 8+ to launch Chrome we rely on Windows to use the |
123 // IExecuteCommand interface exposed by delegate_execute to launch Chrome | 123 // IExecuteCommand interface exposed by delegate_execute to launch Chrome |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 case DelegateExecuteOperation::RELAUNCH_CHROME: | 193 case DelegateExecuteOperation::RELAUNCH_CHROME: |
194 ret_code = RelaunchChrome(operation); | 194 ret_code = RelaunchChrome(operation); |
195 break; | 195 break; |
196 default: | 196 default: |
197 NOTREACHED(); | 197 NOTREACHED(); |
198 } | 198 } |
199 } | 199 } |
200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); | 200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); |
201 return ret_code; | 201 return ret_code; |
202 } | 202 } |
OLD | NEW |