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

Side by Side Diff: chrome/app/chrome_exe_main_win.cc

Issue 2422643002: Windows install_static refactor. (Closed)
Patch Set: sync to position 431863 Created 4 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <windows.h> 5 #include <windows.h>
6 #include <malloc.h> 6 #include <malloc.h>
7 #include <shellscalingapi.h> 7 #include <shellscalingapi.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <tchar.h> 9 #include <tchar.h>
10 10
11 #include <algorithm> 11 #include <algorithm>
12 #include <string> 12 #include <string>
13 13
14 #include "base/at_exit.h" 14 #include "base/at_exit.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/lazy_instance.h"
18 #include "base/logging.h" 17 #include "base/logging.h"
19 #include "base/path_service.h" 18 #include "base/path_service.h"
20 #include "base/strings/string16.h" 19 #include "base/strings/string16.h"
21 #include "base/strings/string_split.h" 20 #include "base/strings/string_split.h"
22 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
23 #include "base/time/time.h" 22 #include "base/time/time.h"
24 #include "base/win/registry.h" 23 #include "base/win/registry.h"
25 #include "base/win/windows_version.h" 24 #include "base/win/windows_version.h"
26 #include "chrome/app/main_dll_loader_win.h" 25 #include "chrome/app/main_dll_loader_win.h"
27 #include "chrome/browser/policy/policy_path_parser.h" 26 #include "chrome/browser/policy/policy_path_parser.h"
28 #include "chrome/browser/win/chrome_process_finder.h" 27 #include "chrome/browser/win/chrome_process_finder.h"
28 #include "chrome/common/chrome_constants.h"
29 #include "chrome/common/chrome_paths_internal.h" 29 #include "chrome/common/chrome_paths_internal.h"
30 #include "chrome/common/chrome_switches.h" 30 #include "chrome/common/chrome_switches.h"
31 #include "chrome/installer/util/browser_distribution.h" 31 #include "chrome/install_static/install_details.h"
32 #include "chrome_elf/chrome_elf_main.h" 32 #include "chrome_elf/chrome_elf_main.h"
33 #include "components/crash/content/app/crash_switches.h" 33 #include "components/crash/content/app/crash_switches.h"
34 #include "components/crash/content/app/crashpad.h" 34 #include "components/crash/content/app/crashpad.h"
35 #include "components/crash/content/app/run_as_crashpad_handler_win.h" 35 #include "components/crash/content/app/run_as_crashpad_handler_win.h"
36 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
37 #include "content/public/common/result_codes.h" 37 #include "content/public/common/result_codes.h"
38 38
39 namespace { 39 namespace {
40 40
41 // List of switches that it's safe to rendezvous early with. Fast start should 41 // List of switches that it's safe to rendezvous early with. Fast start should
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 } // namespace 199 } // namespace
200 200
201 #if !defined(WIN_CONSOLE_APP) 201 #if !defined(WIN_CONSOLE_APP)
202 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { 202 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
203 #else 203 #else
204 int main() { 204 int main() {
205 HINSTANCE instance = GetModuleHandle(nullptr); 205 HINSTANCE instance = GetModuleHandle(nullptr);
206 #endif 206 #endif
207 install_static::InstallDetails::InitializeFromPrimaryModule(
208 chrome::kChromeElfDllName);
207 SignalInitializeCrashReporting(); 209 SignalInitializeCrashReporting();
208 210
209 // Initialize the CommandLine singleton from the environment. 211 // Initialize the CommandLine singleton from the environment.
210 base::CommandLine::Init(0, nullptr); 212 base::CommandLine::Init(0, nullptr);
211 const base::CommandLine* command_line = 213 const base::CommandLine* command_line =
212 base::CommandLine::ForCurrentProcess(); 214 base::CommandLine::ForCurrentProcess();
213 215
214 const std::string process_type = 216 const std::string process_type =
215 command_line->GetSwitchValueASCII(switches::kProcessType); 217 command_line->GetSwitchValueASCII(switches::kProcessType);
216 218
(...skipping 25 matching lines...) Expand all
242 RemoveAppCompatFlagsEntry(); 244 RemoveAppCompatFlagsEntry();
243 245
244 // Load and launch the chrome dll. *Everything* happens inside. 246 // Load and launch the chrome dll. *Everything* happens inside.
245 VLOG(1) << "About to load main DLL."; 247 VLOG(1) << "About to load main DLL.";
246 MainDllLoader* loader = MakeMainDllLoader(); 248 MainDllLoader* loader = MakeMainDllLoader();
247 int rc = loader->Launch(instance, exe_entry_point_ticks); 249 int rc = loader->Launch(instance, exe_entry_point_ticks);
248 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); 250 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
249 delete loader; 251 delete loader;
250 return rc; 252 return rc;
251 } 253 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698