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

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: 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 | « LayoutTests/svg/dispatch-event-crash-on-destruct-expected.txt ('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 63f77b798b68b32676bd20edadb1310669825842..62058ca4639a15aa101a8a53ccac8b6041c3a2ca 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 events but doesn't allow scripts
+ // to run so we can call it in EventDispatchForbiddenScope scope.
esprehn 2014/12/18 06:57:30 I would be more specific and call out that unload
+ EventDispatchForbiddenScope::AllowUserAgentEvents allowEvents;
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 | « LayoutTests/svg/dispatch-event-crash-on-destruct-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698