diff options
author | mnaganov <mnaganov@chromium.org> | 2016-01-07 18:49:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-08 02:50:44 +0000 |
commit | f322c8fea0852d346caba09574a6b0774721f7ca (patch) | |
tree | 151fedc478a7129378154c9acc45c4ffce78105d /android_webview/lib | |
parent | f2d5a89de954b9d4372fa0ab7f44f65b3b5466ed (diff) | |
download | chromium_src-f322c8fea0852d346caba09574a6b0774721f7ca.zip chromium_src-f322c8fea0852d346caba09574a6b0774721f7ca.tar.gz chromium_src-f322c8fea0852d346caba09574a6b0774721f7ca.tar.bz2 |
Distinguish in the browser between renderer crashes and kills
Use a pipe between a browser and a renderer, where the renderer
writes something in case of a termination from a catchable
signal. In case when the renderer is killed by the low memory
killer, nothing gets written into the pipe.
The browser then terminates itself in a fashion similar
to the renderer.
BUG=546009
Review URL: https://codereview.chromium.org/1525023003
Cr-Commit-Position: refs/heads/master@{#368251}
Diffstat (limited to 'android_webview/lib')
-rw-r--r-- | android_webview/lib/main/aw_main_delegate.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc index c9340ff..7025687 100644 --- a/android_webview/lib/main/aw_main_delegate.cc +++ b/android_webview/lib/main/aw_main_delegate.cc @@ -141,6 +141,7 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) { if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) { cl->AppendSwitch(switches::kInProcessGPU); cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); + cl->AppendSwitch(switches::kDisableRendererBackgrounding); } return false; @@ -157,6 +158,7 @@ void AwMainDelegate::PreSandboxStartup() { *base::CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); + int crash_signal_fd = -1; if (process_type == switches::kRendererProcess) { auto global_descriptors = base::GlobalDescriptors::GetInstance(); int pak_fd = global_descriptors->Get(kAndroidWebViewLocalePakDescriptor); @@ -169,6 +171,8 @@ void AwMainDelegate::PreSandboxStartup() { global_descriptors->GetRegion(kAndroidWebViewMainPakDescriptor); ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( base::File(pak_fd), pak_region, ui::SCALE_FACTOR_NONE); + crash_signal_fd = + global_descriptors->Get(kAndroidWebViewCrashSignalDescriptor); } if (process_type.empty() && command_line.HasSwitch(switches::kSingleProcess)) { @@ -176,7 +180,7 @@ void AwMainDelegate::PreSandboxStartup() { process_type = "webview"; } - crash_reporter::EnableMicrodumpCrashReporter(process_type); + crash_reporter::EnableMicrodumpCrashReporter(process_type, crash_signal_fd); } int AwMainDelegate::RunProcess( |