Commit 4faf2d6b authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Fix crash in WebContentsAccessibility

WebContentsAccessibility as the implementation of AccessibilityNodeProvider
can get |createAccessibilityNodeInfo| even past the WebContents finished
its lifecycle. In such case mWebContents should be null-checked to prevent
crash. This CL puts the missing check that caused the reported crash.

Bug: 806033
Change-Id: Ic80a6fd7d6289aab332a60221cd3c7a1c93d12c8
Reviewed-on: https://chromium-review.googlesource.com/887698Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532300}
parent 0deb5531
...@@ -736,6 +736,10 @@ public class WebContentsAccessibility extends AccessibilityNodeProvider ...@@ -736,6 +736,10 @@ public class WebContentsAccessibility extends AccessibilityNodeProvider
* gets initialized first. * gets initialized first.
*/ */
private boolean isFrameInfoInitialized() { private boolean isFrameInfoInitialized() {
if (mWebContents == null) {
// We already got frame info since WebContents finished its lifecycle.
return true;
}
RenderCoordinates rc = mWebContents.getRenderCoordinates(); RenderCoordinates rc = mWebContents.getRenderCoordinates();
return rc.getContentWidthCss() != 0.0 || rc.getContentHeightCss() != 0.0; return rc.getContentWidthCss() != 0.0 || rc.getContentHeightCss() != 0.0;
} }
......
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