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

Issue 1463433002: Use RefPtr for MutationObserver in MutationObserverInterestGroup. (Closed)

Created:
5 years, 1 month ago by kochi
Modified:
5 years, 1 month ago
Reviewers:
tkent
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use RefPtr for MutationObserver in MutationObserverInterestGroup. In MutaionObserverInterestGroup, MutationObservers were held in HashSet as raw pointers. In case a MutationObserver is gone while mutation events are collected (and garbage collector collects the object), it causes use-after-free while the code tries to enqueue the recorded mutation events. Use RefPtr<> to hold the pointer so that the object will be kept until it goes out of scope. BUG=557981 TEST=fast/dom/MutationObserver/mutation-and-deletion-race.html Committed: https://crrev.com/a17c2c87065be2c4dcb586583b1d69a5c85dae20 Cr-Commit-Position: refs/heads/master@{#360541}

Patch Set 1 #

Patch Set 2 : add a test #

Patch Set 3 : Fix the test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -12 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race.html View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race-expected.txt View 1 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Node.cpp View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (4 generated)
kochi
tkent-san, Could you review?
5 years, 1 month ago (2015-11-19 05:53:37 UTC) #4
tkent
lgtm. It seems this CL won't make reference cycles.
5 years, 1 month ago (2015-11-19 06:03:16 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1463433002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1463433002/40001
5 years, 1 month ago (2015-11-19 06:12:13 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 1 month ago (2015-11-19 07:17:52 UTC) #8
commit-bot: I haz the power
5 years, 1 month ago (2015-11-19 07:18:36 UTC) #9
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a17c2c87065be2c4dcb586583b1d69a5c85dae20
Cr-Commit-Position: refs/heads/master@{#360541}

Powered by Google App Engine
This is Rietveld 408576698