mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-14 19:20:46 +01:00
macOS: Support crash reporting from unbundled apps (issue #1532)
This commit is contained in:
parent
da2209a6d8
commit
3561b8dfdb
@ -108,6 +108,9 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
|
|||||||
}),
|
}),
|
||||||
argv.end());
|
argv.end());
|
||||||
|
|
||||||
|
// HandlerMain expects the first argument to be the program name.
|
||||||
|
argv.insert(argv.begin(), command_line.GetProgram().value());
|
||||||
|
|
||||||
std::unique_ptr<char* []> argv_as_utf8(new char*[argv.size() + 1]);
|
std::unique_ptr<char* []> argv_as_utf8(new char*[argv.size() + 1]);
|
||||||
std::vector<std::string> storage;
|
std::vector<std::string> storage;
|
||||||
storage.reserve(argv.size());
|
storage.reserve(argv.size());
|
||||||
|
@ -59,6 +59,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
|
|||||||
// framework dylib is even loaded, to catch potential early crashes.
|
// framework dylib is even loaded, to catch potential early crashes.
|
||||||
crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
|
crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
|
||||||
|
|
||||||
|
if (base::mac::AmIBundled()) {
|
||||||
// Mac Chrome is packaged with a main app bundle and a helper app bundle.
|
// Mac Chrome is packaged with a main app bundle and a helper app bundle.
|
||||||
// The main app bundle should only be used for the browser process, so it
|
// The main app bundle should only be used for the browser process, so it
|
||||||
// should never see a --type switch (switches::kProcessType). Likewise,
|
// should never see a --type switch (switches::kProcessType). Likewise,
|
||||||
@ -78,6 +79,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
|
|||||||
process_type.empty())
|
process_type.empty())
|
||||||
<< "Main application forbids --type, saw " << process_type;
|
<< "Main application forbids --type, saw " << process_type;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_crash_reporting_enabled = true;
|
g_crash_reporting_enabled = true;
|
||||||
#else // !defined(OS_MACOSX)
|
#else // !defined(OS_MACOSX)
|
||||||
|
@ -91,16 +91,16 @@ void OverrideFrameworkBundlePath() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OverrideChildProcessPath() {
|
void OverrideChildProcessPath() {
|
||||||
// ChildProcessHost::GetChildPath() requires either kBrowserSubprocessPath or
|
base::FilePath child_process_path =
|
||||||
// CHILD_PROCESS_EXE but not both.
|
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
|
||||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
switches::kBrowserSubprocessPath);
|
||||||
switches::kBrowserSubprocessPath)) {
|
|
||||||
return;
|
if (child_process_path.empty()) {
|
||||||
|
child_process_path = util_mac::GetChildProcessPath();
|
||||||
|
DCHECK(!child_process_path.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
base::FilePath child_process_path = util_mac::GetChildProcessPath();
|
// Used by ChildProcessHost::GetChildPath and PlatformCrashpadInitialization.
|
||||||
DCHECK(!child_process_path.empty());
|
|
||||||
|
|
||||||
PathService::Override(content::CHILD_PROCESS_EXE, child_process_path);
|
PathService::Override(content::CHILD_PROCESS_EXE, child_process_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user