Commit 32913d08 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Move browser crash key code to cross-platform area

Bug: None
Change-Id: Icaaa7fdc44ad65d0569e2cb412b3671ef70756ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047405Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741623}
parent f27edcbc
......@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/task/post_task.h"
......@@ -231,6 +232,16 @@ void BrowserAccessibilityStateImpl::AddAccessibilityModeFlags(ui::AXMode mode) {
WebContentsImpl::GetAllWebContents();
for (size_t i = 0; i < web_contents_vector.size(); ++i)
web_contents_vector[i]->AddAccessibilityMode(accessibility_mode_);
// Add a crash key with the ax_mode, to enable searching for top crashes that
// occur when accessibility is turned on. This adds it for the browser
// process, and elsewhere the same key is added to renderer processes.
static auto* ax_mode_crash_key = base::debug::AllocateCrashKeyString(
"ax_mode", base::debug::CrashKeySize::Size64);
if (ax_mode_crash_key) {
base::debug::SetCrashKeyString(ax_mode_crash_key,
accessibility_mode_.ToString());
}
}
void BrowserAccessibilityStateImpl::RemoveAccessibilityModeFlags(
......
......@@ -86,6 +86,7 @@ void AXPlatformNode::RemoveAXModeObserver(AXModeObserver* observer) {
// static
void AXPlatformNode::NotifyAddAXModeFlags(AXMode mode_flags) {
// Note: this is only called on Windows.
AXMode new_ax_mode(ax_mode_);
new_ax_mode |= mode_flags;
......@@ -95,14 +96,6 @@ void AXPlatformNode::NotifyAddAXModeFlags(AXMode mode_flags) {
ax_mode_ = new_ax_mode;
for (auto& observer : ax_mode_observers_.Get())
observer.OnAXModeAdded(mode_flags);
// Add a crash key with the ax_mode, to enable searching for top crashes that
// occur when accessibility is turned on. This adds it for the browser
// process, and elsewhere the same key is added to renderer processes.
static auto* ax_mode_crash_key = base::debug::AllocateCrashKeyString(
"ax_mode", base::debug::CrashKeySize::Size64);
if (ax_mode_crash_key)
base::debug::SetCrashKeyString(ax_mode_crash_key, new_ax_mode.ToString());
}
// static
......
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