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

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

Issue 2867063002: Stability instrumentation Crashpad integration (Closed)
Patch Set: MakeProductDetails checks CurrentProcessNeedsProfileDir Created 3 years, 7 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 11 matching lines...) Expand all
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/time/time.h" 23 #include "base/time/time.h"
24 #include "base/win/registry.h" 24 #include "base/win/registry.h"
25 #include "base/win/windows_version.h" 25 #include "base/win/windows_version.h"
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/install_static/initialize_from_primary_module.h" 31 #include "chrome/install_static/initialize_from_primary_module.h"
32 #include "chrome/install_static/install_details.h"
32 #include "chrome/install_static/install_util.h" 33 #include "chrome/install_static/install_util.h"
34 #include "chrome/install_static/user_data_dir.h"
grt (UTC plus 2) 2017/05/19 08:15:50 unused
manzagop (departed) 2017/05/19 22:02:07 Done.
33 #include "chrome_elf/chrome_elf_main.h" 35 #include "chrome_elf/chrome_elf_main.h"
34 #include "components/crash/content/app/crash_switches.h" 36 #include "components/crash/content/app/crash_switches.h"
35 #include "components/crash/content/app/crashpad.h" 37 #include "components/crash/content/app/crashpad.h"
36 #include "components/crash/content/app/fallback_crash_handling_win.h" 38 #include "components/crash/content/app/fallback_crash_handling_win.h"
37 #include "components/crash/content/app/run_as_crashpad_handler_win.h" 39 #include "components/crash/content/app/run_as_crashpad_handler_win.h"
38 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
39 #include "content/public/common/result_codes.h" 41 #include "content/public/common/result_codes.h"
40 42
41 namespace { 43 namespace {
42 44
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 239
238 // Confirm that an explicit prefetch profile is used for all process types 240 // Confirm that an explicit prefetch profile is used for all process types
239 // except for the browser process. Any new process type will have to assign 241 // except for the browser process. Any new process type will have to assign
240 // itself a prefetch id. See kPrefetchArgument* constants in 242 // itself a prefetch id. See kPrefetchArgument* constants in
241 // content_switches.cc for details. 243 // content_switches.cc for details.
242 DCHECK(process_type.empty() || 244 DCHECK(process_type.empty() ||
243 HasValidWindowsPrefetchArgument(*command_line)); 245 HasValidWindowsPrefetchArgument(*command_line));
244 246
245 if (process_type == crash_reporter::switches::kCrashpadHandler) { 247 if (process_type == crash_reporter::switches::kCrashpadHandler) {
246 crash_reporter::SetupFallbackCrashHandling(*command_line); 248 crash_reporter::SetupFallbackCrashHandling(*command_line);
249 base::string16 user_data_dir =
250 install_static::InstallDetails::Get().user_data_dir();
247 return crash_reporter::RunAsCrashpadHandler( 251 return crash_reporter::RunAsCrashpadHandler(
248 *base::CommandLine::ForCurrentProcess(), switches::kProcessType); 252 *base::CommandLine::ForCurrentProcess(), base::FilePath(user_data_dir),
253 switches::kProcessType, switches::kUserDataDir);
249 } else if (process_type == crash_reporter::switches::kFallbackCrashHandler) { 254 } else if (process_type == crash_reporter::switches::kFallbackCrashHandler) {
250 return RunFallbackCrashHandler(*command_line); 255 return RunFallbackCrashHandler(*command_line);
251 } 256 }
252 257
253 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now(); 258 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now();
254 259
255 // Signal Chrome Elf that Chrome has begun to start. 260 // Signal Chrome Elf that Chrome has begun to start.
256 SignalChromeElf(); 261 SignalChromeElf();
257 262
258 // The exit manager is in charge of calling the dtors of singletons. 263 // The exit manager is in charge of calling the dtors of singletons.
259 base::AtExitManager exit_manager; 264 base::AtExitManager exit_manager;
260 265
261 EnableHighDPISupport(); 266 EnableHighDPISupport();
262 267
263 if (AttemptFastNotify(*command_line)) 268 if (AttemptFastNotify(*command_line))
264 return 0; 269 return 0;
265 270
266 RemoveAppCompatFlagsEntry(); 271 RemoveAppCompatFlagsEntry();
267 272
268 // Load and launch the chrome dll. *Everything* happens inside. 273 // Load and launch the chrome dll. *Everything* happens inside.
269 VLOG(1) << "About to load main DLL."; 274 VLOG(1) << "About to load main DLL.";
270 MainDllLoader* loader = MakeMainDllLoader(); 275 MainDllLoader* loader = MakeMainDllLoader();
271 int rc = loader->Launch(instance, exe_entry_point_ticks); 276 int rc = loader->Launch(instance, exe_entry_point_ticks);
272 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); 277 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
273 delete loader; 278 delete loader;
274 return rc; 279 return rc;
275 } 280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698