Commit 7516f830 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

Fix memory leak in inspector

The overlay agent is keeping a map from documents to
a corresponding AXContext, but is holding on strongly
to documents. This causes windows to not be flagged as
detached (because the retaining chain through the inspector
agent looks like it is alive).

Bug: chromium:1110817, chromium:1112066, chromium:1128371
Change-Id: I7c3930f42e29a01634731379f7717257569303c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410864
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807004}
parent d21089b7
...@@ -284,7 +284,7 @@ class CORE_EXPORT InspectorOverlayAgent final ...@@ -284,7 +284,7 @@ class CORE_EXPORT InspectorOverlayAgent final
Member<Hinge> hinge_; Member<Hinge> hinge_;
// The agent needs to keep AXContext because it enables caching of // The agent needs to keep AXContext because it enables caching of
// a11y attributes shown in the inspector overlay. // a11y attributes shown in the inspector overlay.
HeapHashMap<Member<Document>, std::unique_ptr<AXContext>> HeapHashMap<WeakMember<Document>, std::unique_ptr<AXContext>>
document_to_ax_context_; document_to_ax_context_;
bool swallow_next_mouse_up_; bool swallow_next_mouse_up_;
DOMNodeId backend_node_id_to_inspect_; DOMNodeId backend_node_id_to_inspect_;
......
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