Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1388)

Unified Diff: Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1153723008: Don't create an AXScrollView for a FrameView that's about to be deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add more comments based on review Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/accessibility/event-on-deleted-iframe-causes-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/Source/modules/accessibility/AXObjectCacheImpl.cpp b/Source/modules/accessibility/AXObjectCacheImpl.cpp
index 33382b11bcac5d116acc81cdd9f7f6c38f972d72..6d561f68c297ab6011e98be5461288e708faf69d 100644
--- a/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -345,9 +345,16 @@ AXObject* AXObjectCacheImpl::getOrCreate(Widget* widget)
return obj;
RefPtr<AXObject> newObj = nullptr;
- if (widget->isFrameView())
+ if (widget->isFrameView()) {
+ FrameView* frameView = toFrameView(widget);
+
+ // Don't create an AXScrollView for a FrameView that isn't attached to a frame,
+ // for example if it's in the process of being disposed.
+ if (frameView->frame().view() != frameView || !frameView->layoutView())
+ return 0;
+
newObj = AXScrollView::create(toFrameView(widget), this);
- else if (widget->isScrollbar())
+ } else if (widget->isScrollbar())
newObj = AXScrollbar::create(toScrollbar(widget), this);
// Will crash later if we have two objects for the same widget.
« no previous file with comments | « LayoutTests/accessibility/event-on-deleted-iframe-causes-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698