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

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

Issue 2345933002: Break chrome_initial's dependence on //components/startup_metric_utils/browser:lib (Closed)
Patch Set: fdoray feedback Created 4 years, 3 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) 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
(...skipping 15 matching lines...) Expand all
26 #include "chrome/app/main_dll_loader_win.h" 26 #include "chrome/app/main_dll_loader_win.h"
27 #include "chrome/browser/policy/policy_path_parser.h" 27 #include "chrome/browser/policy/policy_path_parser.h"
28 #include "chrome/browser/win/chrome_process_finder.h" 28 #include "chrome/browser/win/chrome_process_finder.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/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 "components/startup_metric_utils/browser/startup_metric_utils.h"
37 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
38 #include "content/public/common/result_codes.h" 37 #include "content/public/common/result_codes.h"
39 38
40 namespace { 39 namespace {
41 40
42 // 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
43 // not be done if a command line contains a switch not in this set. 42 // not be done if a command line contains a switch not in this set.
44 // Note this is currently stored as a list of two because it's probably faster 43 // Note this is currently stored as a list of two because it's probably faster
45 // to iterate over this small array than building a map for constant time 44 // to iterate over this small array than building a map for constant time
46 // lookups. 45 // lookups.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // itself a prefetch id. See kPrefetchArgument* constants in 217 // itself a prefetch id. See kPrefetchArgument* constants in
219 // content_switches.cc for details. 218 // content_switches.cc for details.
220 DCHECK(process_type.empty() || 219 DCHECK(process_type.empty() ||
221 HasValidWindowsPrefetchArgument(*command_line)); 220 HasValidWindowsPrefetchArgument(*command_line));
222 221
223 if (process_type == crash_reporter::switches::kCrashpadHandler) { 222 if (process_type == crash_reporter::switches::kCrashpadHandler) {
224 return crash_reporter::RunAsCrashpadHandler( 223 return crash_reporter::RunAsCrashpadHandler(
225 *base::CommandLine::ForCurrentProcess()); 224 *base::CommandLine::ForCurrentProcess());
226 } 225 }
227 226
228 startup_metric_utils::RecordExeMainEntryPointTime(base::Time::Now()); 227 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now();
229 228
230 // Signal Chrome Elf that Chrome has begun to start. 229 // Signal Chrome Elf that Chrome has begun to start.
231 SignalChromeElf(); 230 SignalChromeElf();
232 231
233 // The exit manager is in charge of calling the dtors of singletons. 232 // The exit manager is in charge of calling the dtors of singletons.
234 base::AtExitManager exit_manager; 233 base::AtExitManager exit_manager;
235 234
236 EnableHighDPISupport(); 235 EnableHighDPISupport();
237 236
238 if (AttemptFastNotify(*command_line)) 237 if (AttemptFastNotify(*command_line))
239 return 0; 238 return 0;
240 239
241 RemoveAppCompatFlagsEntry(); 240 RemoveAppCompatFlagsEntry();
242 241
243 // Load and launch the chrome dll. *Everything* happens inside. 242 // Load and launch the chrome dll. *Everything* happens inside.
244 VLOG(1) << "About to load main DLL."; 243 VLOG(1) << "About to load main DLL.";
245 MainDllLoader* loader = MakeMainDllLoader(); 244 MainDllLoader* loader = MakeMainDllLoader();
246 int rc = loader->Launch(instance); 245 int rc = loader->Launch(instance, exe_entry_point_ticks);
247 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); 246 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
248 delete loader; 247 delete loader;
249 return rc; 248 return rc;
250 } 249 }
OLDNEW
« no previous file with comments | « chrome/BUILD.gn ('k') | chrome/app/chrome_main.cc » ('j') | chrome/app/main_dll_loader_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698