-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
7546: Dumb fix to prevent crash related to accessibility keyboard.
Fixes brave/brave-browser#7546 Related upstream bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=1029719 https://bugs.chromium.org/p/chromium/issues/detail?id=1133086 It is pretty hard to craft a proper fix so we just add an extra check and try to return quickly (along with sending a pseudo crash dump).
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
chromium_src/content/browser/accessibility/browser_accessibility_cocoa.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "base/debug/dump_without_crashing.h" | ||
|
||
#define BRAVE_FORPARAMETER \ | ||
if (startOffset < 0 || endOffset < 0) { \ | ||
base::debug::DumpWithoutCrashing(); \ | ||
return nil; \ | ||
} | ||
|
||
#include "../../../../../../../content/browser/accessibility/browser_accessibility_cocoa.mm" |
12 changes: 12 additions & 0 deletions
12
patches/content-browser-accessibility-browser_accessibility_cocoa.mm.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm | ||
index d792b573258714648c8ce66bedc2fbb4e7417028..76bf56f79848d72067cee0835611962dc791cc55 100644 | ||
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm | ||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm | ||
@@ -3164,6 +3164,7 @@ id content::AXTextMarkerRangeFrom(id anchor_textmarker, id focus_textmarker) { | ||
endObject = range.focus()->GetAnchor(); | ||
startOffset = range.anchor()->text_offset(); | ||
endOffset = range.focus()->text_offset(); | ||
+ BRAVE_FORPARAMETER | ||
DCHECK(startObject && endObject); | ||
DCHECK_GE(startOffset, 0); | ||
DCHECK_GE(endOffset, 0); |