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

Issue 1186093003: Reland: Window.postMessage() to self can cause document leaks (Closed)

Created:
5 years, 6 months ago by landell
Modified:
5 years, 6 months ago
Reviewers:
haraken, sigbjornf
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Reland: Window.postMessage() to self can cause document leaks When a script does Window.postMessage() a PostMessageTimer object is stored in the LocalDOMWindow until the message has been delivered, or until it is cleared in the destructor of LocalDOMWindow. When a LocalDOMWindow is reset the remaining messages will not be delivered. Any PostMessageTimer objects alive at that point will be kept until the LocalDOMWindow is destroyed. Unfortunately, the PostMessageTimer objects keeps a reference to the source window. If both the source and destination window of the message is the same, the PostMessageTimer can keep that LocalDOMWindow from getting destroyed. Removing the PostMessageTimers when stop() is invoked fixes the problem. BUG=500821, 499692 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197252

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -5 lines) Patch
A LayoutTests/fast/dom/Window/post-message-detach-in-handler.html View 1 chunk +32 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/dom/Window/post-message-to-self.html View 1 chunk +31 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/Window/post-message-to-self-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/frame/LocalDOMWindow.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/LocalDOMWindow.cpp View 6 chunks +20 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
landell
@reviewers: PTAL This adds fix for crash regression issue 499692, incorporating sigbjorn's test case. The ...
5 years, 6 months ago (2015-06-16 10:11:48 UTC) #2
haraken
LGTM
5 years, 6 months ago (2015-06-16 15:58:31 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186093003/1
5 years, 6 months ago (2015-06-17 09:05:08 UTC) #5
commit-bot: I haz the power
5 years, 6 months ago (2015-06-17 11:55:21 UTC) #6
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197252

Powered by Google App Engine
This is Rietveld 408576698