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

Unified Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 787143002: Enable SVGImage to dispatch events in the destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update according to esprehn's comment. Created 6 years 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 | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index ad41c4869b097d7c5af06458bd72018f4fb87f07..03b37f5d4ad24c90ccc9823372ccf8f17098fa28 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -64,6 +64,9 @@ SVGImage::SVGImage(ImageObserver* observer)
SVGImage::~SVGImage()
{
+ // willBeDestroyed() will fire an unload event against the SVGImage's window object
+ // that can't have listeners so we can call it in EventDispatchForbiddenScope scope.
+ EventDispatchForbiddenScope::AllowUserAgentEvents allowEvents;
esprehn 2015/01/09 00:55:06 Why do you still need this if you have the SVGImag
if (m_page) {
// Store m_page in a local variable, clearing m_page, so that SVGImageChromeClient knows we're destructed.
OwnPtrWillBeRawPtr<Page> currentPage = m_page.release();
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698