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

Issue 258843002: Remove unsound asserts in the DOMWindow destructor. (Closed)

Created:
6 years, 8 months ago by sof
Modified:
6 years, 8 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Remove unsound asserts in the DOMWindow destructor. DOMWindow creates its sub-objects (Location, History, ..) on first access, and when the window is closed and detached from its frame, those sub-objects are cleared out. When the DOMWindow object is subsequently destructed, we assert that those objects have all been cleared (i.e., that reset() has been called and the expected window shutdown sequence was followed.) However, the wrapper object is still alive, so if scripts access the sub-objects of this detached&reset window object, they'll be created again. As they need to be, but this invalidates the condition that the destructor asserts for -- one or more of these objects will now be set. Remove the invalid asserts, but do check that reset() has been called (at least once) before a DOMWindow is destructed. R=abarth@chromium.org BUG=351133 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172680

Patch Set 1 #

Patch Set 2 : Use ASSERT_DISABLED #

Total comments: 2

Patch Set 3 : Invert and use ASSERT_ENABLED #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -26 lines) Patch
M LayoutTests/fast/dom/Window/Location/set-location-after-close.html View 2 chunks +20 lines, -8 lines 0 comments Download
M LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt View 1 chunk +9 lines, -1 line 0 comments Download
M Source/core/frame/DOMWindow.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/frame/DOMWindow.cpp View 1 2 3 chunks +7 lines, -17 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
sof
Please take a look.
6 years, 8 months ago (2014-04-25 20:30:19 UTC) #1
abarth-chromium
LGTM https://codereview.chromium.org/258843002/diff/20001/Source/core/frame/DOMWindow.h File Source/core/frame/DOMWindow.h (right): https://codereview.chromium.org/258843002/diff/20001/Source/core/frame/DOMWindow.h#newcode349 Source/core/frame/DOMWindow.h:349: #if !ASSERT_DISABLED #if ASSERT_ENABLED
6 years, 8 months ago (2014-04-25 21:01:02 UTC) #2
sof
https://codereview.chromium.org/258843002/diff/20001/Source/core/frame/DOMWindow.h File Source/core/frame/DOMWindow.h (right): https://codereview.chromium.org/258843002/diff/20001/Source/core/frame/DOMWindow.h#newcode349 Source/core/frame/DOMWindow.h:349: #if !ASSERT_DISABLED On 2014/04/25 21:01:03, abarth wrote: > #if ...
6 years, 8 months ago (2014-04-25 21:42:23 UTC) #3
sof
6 years, 8 months ago (2014-04-25 21:42:24 UTC) #4
sof
The CQ bit was checked by sigbjornf@opera.com
6 years, 8 months ago (2014-04-25 21:42:34 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/258843002/40001
6 years, 8 months ago (2014-04-25 21:43:21 UTC) #6
commit-bot: I haz the power
6 years, 8 months ago (2014-04-25 23:07:39 UTC) #7
Message was sent while issue was closed.
Change committed as 172680

Powered by Google App Engine
This is Rietveld 408576698