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

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 759903002: Upgrade the windows specific version of LaunchProcess to avoid raw handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome build Created 6 years 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 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 150
151 CommandLine cmd(CommandLine::FromString(cmd_str)); 151 CommandLine cmd(CommandLine::FromString(cmd_str));
152 // Force creation of shortcuts as the First Run beacon might land between now 152 // Force creation of shortcuts as the First Run beacon might land between now
153 // and the time setup.exe checks for it. 153 // and the time setup.exe checks for it.
154 cmd.AppendSwitch(installer::switches::kForceConfigureUserSettings); 154 cmd.AppendSwitch(installer::switches::kForceConfigureUserSettings);
155 155
156 base::LaunchOptions launch_options; 156 base::LaunchOptions launch_options;
157 if (base::win::IsMetroProcess()) 157 if (base::win::IsMetroProcess())
158 launch_options.force_breakaway_from_job_ = true; 158 launch_options.force_breakaway_from_job_ = true;
159 if (!base::LaunchProcess(cmd.GetCommandLineString(), launch_options, NULL)) 159 base::Process process =
160 base::LaunchProcess(cmd.GetCommandLineString(), launch_options);
161 if (!process.IsValid())
160 PLOG(ERROR) << cmd.GetCommandLineString(); 162 PLOG(ERROR) << cmd.GetCommandLineString();
161 } 163 }
162 164
163 bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { 165 bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) {
164 base::FilePath::StringType program(cmd.GetProgram().value()); 166 base::FilePath::StringType program(cmd.GetProgram().value());
165 DCHECK(!program.empty()); 167 DCHECK(!program.empty());
166 DCHECK_NE(program[0], L'\"'); 168 DCHECK_NE(program[0], L'\"');
167 169
168 CommandLine::StringType params(cmd.GetCommandLineString()); 170 CommandLine::StringType params(cmd.GetCommandLineString());
169 if (params[0] == '"') { 171 if (params[0] == '"') {
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 // Open the program and see if it references the expected file. 648 // Open the program and see if it references the expected file.
647 base::File file; 649 base::File file;
648 BY_HANDLE_FILE_INFORMATION info = {}; 650 BY_HANDLE_FILE_INFORMATION info = {};
649 651
650 return (OpenForInfo(path, &file) && 652 return (OpenForInfo(path, &file) &&
651 GetInfo(file, &info) && 653 GetInfo(file, &info) &&
652 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && 654 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber &&
653 info.nFileIndexHigh == file_info_.nFileIndexHigh && 655 info.nFileIndexHigh == file_info_.nFileIndexHigh &&
654 info.nFileIndexLow == file_info_.nFileIndexLow); 656 info.nFileIndexLow == file_info_.nFileIndexLow);
655 } 657 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_update_util.cc ('k') | cloud_print/virtual_driver/win/install/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698