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

Unified Diff: trunk/Source/core/frame/LocalDOMWindow.cpp

Issue 1176113004: Revert 196930 "Window.postMessage() to self can cause document l..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 5 years, 6 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 | « trunk/Source/core/frame/LocalDOMWindow.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/frame/LocalDOMWindow.cpp
===================================================================
--- trunk/Source/core/frame/LocalDOMWindow.cpp (revision 197008)
+++ trunk/Source/core/frame/LocalDOMWindow.cpp (working copy)
@@ -126,12 +126,6 @@
SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); }
ScriptCallStack* stackTrace() const { return m_stackTrace.get(); }
UserGestureToken* userGestureToken() const { return m_userGestureToken.get(); }
- virtual void stop() override
- {
- SuspendableTimer::stop();
- // Will destroy this object
- m_window->removePostMessageTimer(this);
- }
DEFINE_INLINE_VIRTUAL_TRACE()
{
@@ -146,8 +140,7 @@
{
InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(executionContext(), m_asyncOperationId);
m_window->postMessageTimerFired(this);
- // Will destroy this object
- m_window->removePostMessageTimer(this);
+ // This object is deleted now.
InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
@@ -667,6 +660,7 @@
void LocalDOMWindow::postMessageTimerFired(PostMessageTimer* timer)
{
if (!isCurrentlyDisplayedInFrame()) {
+ m_postMessageTimers.remove(timer);
return;
}
@@ -676,10 +670,6 @@
event->entangleMessagePorts(document());
dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->stackTrace());
-}
-
-void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer)
-{
m_postMessageTimers.remove(timer);
}
« no previous file with comments | « trunk/Source/core/frame/LocalDOMWindow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698