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

Side by Side Diff: chrome/browser/first_run/upgrade_util_win.cc

Issue 606473002: Remove implicit HANDLE conversions from chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove spurious file and fix indent (+rebase) Created 6 years, 2 months 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
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 #include "chrome/browser/first_run/upgrade_util.h" 5 #include "chrome/browser/first_run/upgrade_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <psapi.h> 8 #include <psapi.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // First try to rename exe by launching rename command ourselves. 257 // First try to rename exe by launching rename command ourselves.
258 std::wstring rename_cmd; 258 std::wstring rename_cmd;
259 if (key.ReadValue(google_update::kRegRenameCmdField, 259 if (key.ReadValue(google_update::kRegRenameCmdField,
260 &rename_cmd) == ERROR_SUCCESS) { 260 &rename_cmd) == ERROR_SUCCESS) {
261 base::win::ScopedHandle handle; 261 base::win::ScopedHandle handle;
262 base::LaunchOptions options; 262 base::LaunchOptions options;
263 options.wait = true; 263 options.wait = true;
264 options.start_hidden = true; 264 options.start_hidden = true;
265 if (base::LaunchProcess(rename_cmd, options, &handle)) { 265 if (base::LaunchProcess(rename_cmd, options, &handle)) {
266 DWORD exit_code; 266 DWORD exit_code;
267 ::GetExitCodeProcess(handle, &exit_code); 267 ::GetExitCodeProcess(handle.Get(), &exit_code);
268 if (exit_code == installer::RENAME_SUCCESSFUL) 268 if (exit_code == installer::RENAME_SUCCESSFUL)
269 return true; 269 return true;
270 } 270 }
271 } 271 }
272 } 272 }
273 273
274 // Rename didn't work so try to rename by calling Google Update 274 // Rename didn't work so try to rename by calling Google Update
275 return InvokeGoogleUpdateForRename(); 275 return InvokeGoogleUpdateForRename();
276 } 276 }
277 277
(...skipping 26 matching lines...) Expand all
304 return false; 304 return false;
305 // At this point the chrome.exe has been swapped with the new one. 305 // At this point the chrome.exe has been swapped with the new one.
306 if (!RelaunchChromeBrowser(command_line)) { 306 if (!RelaunchChromeBrowser(command_line)) {
307 // The re-launch fails. Feel free to panic now. 307 // The re-launch fails. Feel free to panic now.
308 NOTREACHED(); 308 NOTREACHED();
309 } 309 }
310 return true; 310 return true;
311 } 311 }
312 312
313 } // namespace upgrade_util 313 } // namespace upgrade_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698