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

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

Issue 2491463002: Revert of Windows install_static refactor. (Closed)
Patch Set: 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
« no previous file with comments | « chrome/app/chrome_crash_reporter_client_win.cc ('k') | chrome/app/chrome_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/path_service.h" 19 #include "base/path_service.h"
19 #include "base/strings/string16.h" 20 #include "base/strings/string16.h"
20 #include "base/strings/string_split.h" 21 #include "base/strings/string_split.h"
21 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
22 #include "base/time/time.h" 23 #include "base/time/time.h"
23 #include "base/win/registry.h" 24 #include "base/win/registry.h"
24 #include "base/win/windows_version.h" 25 #include "base/win/windows_version.h"
25 #include "chrome/app/main_dll_loader_win.h" 26 #include "chrome/app/main_dll_loader_win.h"
26 #include "chrome/browser/policy/policy_path_parser.h" 27 #include "chrome/browser/policy/policy_path_parser.h"
27 #include "chrome/browser/win/chrome_process_finder.h" 28 #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/install_static/install_details.h" 31 #include "chrome/installer/util/browser_distribution.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);
209 SignalInitializeCrashReporting(); 207 SignalInitializeCrashReporting();
210 208
211 // Initialize the CommandLine singleton from the environment. 209 // Initialize the CommandLine singleton from the environment.
212 base::CommandLine::Init(0, nullptr); 210 base::CommandLine::Init(0, nullptr);
213 const base::CommandLine* command_line = 211 const base::CommandLine* command_line =
214 base::CommandLine::ForCurrentProcess(); 212 base::CommandLine::ForCurrentProcess();
215 213
216 const std::string process_type = 214 const std::string process_type =
217 command_line->GetSwitchValueASCII(switches::kProcessType); 215 command_line->GetSwitchValueASCII(switches::kProcessType);
218 216
(...skipping 25 matching lines...) Expand all
244 RemoveAppCompatFlagsEntry(); 242 RemoveAppCompatFlagsEntry();
245 243
246 // Load and launch the chrome dll. *Everything* happens inside. 244 // Load and launch the chrome dll. *Everything* happens inside.
247 VLOG(1) << "About to load main DLL."; 245 VLOG(1) << "About to load main DLL.";
248 MainDllLoader* loader = MakeMainDllLoader(); 246 MainDllLoader* loader = MakeMainDllLoader();
249 int rc = loader->Launch(instance, exe_entry_point_ticks); 247 int rc = loader->Launch(instance, exe_entry_point_ticks);
250 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); 248 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
251 delete loader; 249 delete loader;
252 return rc; 250 return rc;
253 } 251 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_crash_reporter_client_win.cc ('k') | chrome/app/chrome_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698