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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2900893003: Don't store raw pointers in BrowserAccessibilityManager::tree_changes_ (Closed)
Patch Set: Created 3 years, 7 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 | « content/browser/accessibility/browser_accessibility_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_manager.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 264a86bf9c05b2cdd2973ab9a24ec108cf0b2942..6a197ca1e3f426d563171d9aa47439e48426d143 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -389,8 +389,11 @@ void BrowserAccessibilityManager::OnAccessibilityEvents(
// Fire any events related to changes to the tree.
for (auto& event : tree_events_) {
+ BrowserAccessibility* event_target = GetFromID(event.second);
+ if (!event_target)
+ continue;
NotifyAccessibilityEvent(BrowserAccessibilityEvent::FromTreeChange,
- event.first, event.second);
+ event.first, event_target);
}
tree_events_.clear();
@@ -1190,11 +1193,12 @@ void BrowserAccessibilityManager::OnAtomicUpdateFinished(
DCHECK(created_node);
BrowserAccessibility* object = GetFromAXNode(created_node);
if (object && object->HasStringAttribute(ui::AX_ATTR_LIVE_STATUS)) {
+ int32_t id = object->GetId();
if (object->GetRole() == ui::AX_ROLE_ALERT) {
- tree_events_.push_back(std::make_pair(ui::AX_EVENT_ALERT, object));
+ tree_events_.push_back(std::make_pair(ui::AX_EVENT_ALERT, id));
} else {
tree_events_.push_back(
- std::make_pair(ui::AX_EVENT_LIVE_REGION_CREATED, object));
+ std::make_pair(ui::AX_EVENT_LIVE_REGION_CREATED, id));
}
}
}
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698