Commit 06370fda authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Fix a lacros crash on launch.

crashpad_handler needs to know where to put crashes. By default it uses
the default UserDataDir and does not have support for --user-data-dir.
If the default UserDataDir is not writable, then lacros fails to launch.

This CL sets --breakpad-dump-location when launching lacros, effectively
overriding the default.

Change-Id: I9e31bc14ed721a3984f42f30f94d4214d672daa3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2350124
Commit-Queue: Erik Chen <erikchen@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797094}
parent 227ad6a6
...@@ -185,6 +185,8 @@ bool BrowserManager::Start() { ...@@ -185,6 +185,8 @@ bool BrowserManager::Start() {
// Paths are UTF-8 safe on Chrome OS. // Paths are UTF-8 safe on Chrome OS.
std::string user_data_dir = browser_util::GetUserDataDir().AsUTF8Unsafe(); std::string user_data_dir = browser_util::GetUserDataDir().AsUTF8Unsafe();
std::string crash_dir =
browser_util::GetUserDataDir().Append("crash_dumps").AsUTF8Unsafe();
std::vector<std::string> argv = {chrome_path, std::vector<std::string> argv = {chrome_path,
"--ozone-platform=wayland", "--ozone-platform=wayland",
...@@ -192,7 +194,8 @@ bool BrowserManager::Start() { ...@@ -192,7 +194,8 @@ bool BrowserManager::Start() {
"--enable-gpu-rasterization", "--enable-gpu-rasterization",
"--enable-oop-rasterization", "--enable-oop-rasterization",
"--lang=en-US", "--lang=en-US",
"--enable-crashpad"}; "--enable-crashpad",
"--breakpad-dump-location=" + crash_dir};
std::string additional_flags = std::string additional_flags =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
...@@ -215,6 +218,8 @@ bool BrowserManager::Start() { ...@@ -215,6 +218,8 @@ bool BrowserManager::Start() {
// Set up Mojo channel. // Set up Mojo channel.
base::CommandLine command_line(argv); base::CommandLine command_line(argv);
LOG(WARNING) << "Launching lacros with command: "
<< command_line.GetCommandLineString();
mojo::PlatformChannel channel; mojo::PlatformChannel channel;
channel.PrepareToPassRemoteEndpoint(&options, &command_line); channel.PrepareToPassRemoteEndpoint(&options, &command_line);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment