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

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 11417036: Fix user-level Chrome self-destruction issues on Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
OLDNEW
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 // This file defines the methods useful for uninstalling Chrome. 5 // This file defines the methods useful for uninstalling Chrome.
6 6
7 #include "chrome/installer/setup/uninstall.h" 7 #include "chrome/installer/setup/uninstall.h"
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 std::string reactivation_brand(WideToASCII(reactivation_brand_wide)); 178 std::string reactivation_brand(WideToASCII(reactivation_brand_wide));
179 rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str()); 179 rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str());
180 rlz_lib::ClearProductState(rlz_lib::CHROME, points); 180 rlz_lib::ClearProductState(rlz_lib::CHROME, points);
181 } 181 }
182 } 182 }
183 183
184 } // namespace 184 } // namespace
185 185
186 namespace installer { 186 namespace installer {
187 187
188 // This functions checks for any Chrome instances that are 188 // Kills all Chrome processes, immediately.
189 // running and first asks them to close politely by sending a Windows message.
190 // If there is an error while sending message or if there are still Chrome
191 // procesess active after the message has been sent, this function will try
192 // to kill them.
193 void CloseAllChromeProcesses() { 189 void CloseAllChromeProcesses() {
194 for (int j = 0; j < 4; ++j) { 190 base::CleanupProcesses(installer::kChromeExe, base::TimeDelta(),
grt (UTC plus 2) 2012/11/16 21:11:24 can this be made to kill only the chrome being uni
gab 2012/11/20 00:46:36 As per F2F discussion, we would like to fix this,
grt (UTC plus 2) 2012/11/20 02:35:38 oh yeah. thanks for the reminder.
195 string16 wnd_class(L"Chrome_WidgetWin_");
196 wnd_class.append(base::IntToString16(j));
197 HWND window = FindWindowEx(NULL, NULL, wnd_class.c_str(), NULL);
198 while (window) {
199 HWND tmpWnd = window;
200 window = FindWindowEx(NULL, window, wnd_class.c_str(), NULL);
201 if (!SendMessageTimeout(tmpWnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 3000, NULL) &&
202 (GetLastError() == ERROR_TIMEOUT)) {
203 base::CleanupProcesses(installer::kChromeExe, base::TimeDelta(),
204 content::RESULT_CODE_HUNG, NULL);
205 base::CleanupProcesses(installer::kNaClExe, base::TimeDelta(),
206 content::RESULT_CODE_HUNG, NULL);
207 return;
208 }
209 }
210 }
211
212 // If asking politely didn't work, wait for 15 seconds and then kill all
213 // chrome.exe. This check is just in case Chrome is ignoring WM_CLOSE
214 // messages.
215 base::CleanupProcesses(installer::kChromeExe,
216 base::TimeDelta::FromSeconds(15),
217 content::RESULT_CODE_HUNG, NULL); 191 content::RESULT_CODE_HUNG, NULL);
218 base::CleanupProcesses(installer::kNaClExe, 192 base::CleanupProcesses(installer::kNaClExe, base::TimeDelta(),
219 base::TimeDelta::FromSeconds(15),
220 content::RESULT_CODE_HUNG, NULL); 193 content::RESULT_CODE_HUNG, NULL);
221 } 194 }
grt (UTC plus 2) 2012/11/16 21:11:24 how about killing delegate_execute.exe, too?
gab 2012/11/20 00:46:36 Done. However I just thought that "delegate_execut
grt (UTC plus 2) 2012/11/20 02:35:38 hmm. that's a good point. i think we should see
gab 2012/11/20 15:38:06 s/should/could
222 195
223 // Attempts to close the Chrome Frame helper process by sending WM_CLOSE 196 // Attempts to close the Chrome Frame helper process by sending WM_CLOSE
224 // messages to its window, or just killing it if that doesn't work. 197 // messages to its window, or just killing it if that doesn't work.
225 void CloseChromeFrameHelperProcess() { 198 void CloseChromeFrameHelperProcess() {
226 HWND window = FindWindow(installer::kChromeFrameHelperWndClass, NULL); 199 HWND window = FindWindow(installer::kChromeFrameHelperWndClass, NULL);
227 if (!::IsWindow(window)) 200 if (!::IsWindow(window))
228 return; 201 return;
229 202
230 const DWORD kWaitMs = 3000; 203 const DWORD kWaitMs = 3000;
231 204
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 1240
1268 // Try and delete the preserved local state once the post-install 1241 // Try and delete the preserved local state once the post-install
1269 // operations are complete. 1242 // operations are complete.
1270 if (!backup_state_file.empty()) 1243 if (!backup_state_file.empty())
1271 file_util::Delete(backup_state_file, false); 1244 file_util::Delete(backup_state_file, false);
1272 1245
1273 return ret; 1246 return ret;
1274 } 1247 }
1275 1248
1276 } // namespace installer 1249 } // namespace installer
OLDNEW
« chrome/browser/chrome_browser_main_win.cc ('K') | « chrome/browser/chrome_browser_main_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698