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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 namespace blink { 58 namespace blink {
59 59
60 SVGImage::SVGImage(ImageObserver* observer) 60 SVGImage::SVGImage(ImageObserver* observer)
61 : Image(observer) 61 : Image(observer)
62 { 62 {
63 } 63 }
64 64
65 SVGImage::~SVGImage() 65 SVGImage::~SVGImage()
66 { 66 {
67 // willBeDestroyed() will fire an unload event against the SVGImage's window object
68 // that can't have listeners so we can call it in EventDispatchForbiddenScop e scope.
69 EventDispatchForbiddenScope::AllowUserAgentEvents allowEvents;
esprehn 2015/01/09 00:55:06 Why do you still need this if you have the SVGImag
67 if (m_page) { 70 if (m_page) {
68 // Store m_page in a local variable, clearing m_page, so that SVGImageCh romeClient knows we're destructed. 71 // Store m_page in a local variable, clearing m_page, so that SVGImageCh romeClient knows we're destructed.
69 OwnPtrWillBeRawPtr<Page> currentPage = m_page.release(); 72 OwnPtrWillBeRawPtr<Page> currentPage = m_page.release();
70 // Break both the loader and view references to the frame 73 // Break both the loader and view references to the frame
71 currentPage->willBeDestroyed(); 74 currentPage->willBeDestroyed();
72 } 75 }
73 76
74 // Verify that page teardown destroyed the Chrome 77 // Verify that page teardown destroyed the Chrome
75 ASSERT(!m_chromeClient || !m_chromeClient->image()); 78 ASSERT(!m_chromeClient || !m_chromeClient->image());
76 } 79 }
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 439
437 return m_page; 440 return m_page;
438 } 441 }
439 442
440 String SVGImage::filenameExtension() const 443 String SVGImage::filenameExtension() const
441 { 444 {
442 return "svg"; 445 return "svg";
443 } 446 }
444 447
445 } 448 }
OLDNEW
« 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