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

Unified Diff: Source/core/html/ImageDocument.cpp

Issue 1238083002: Oilpan: Move the EventListener hierarchy to Oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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
Index: Source/core/html/ImageDocument.cpp
diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp
index 18ef33d48e0cc0472813dc484e87b921acb8cddd..a34707c26c84e7a99fdb9099125eac134d1b4080 100644
--- a/Source/core/html/ImageDocument.cpp
+++ b/Source/core/html/ImageDocument.cpp
@@ -56,7 +56,10 @@ using namespace HTMLNames;
class ImageEventListener : public EventListener {
public:
- static PassRefPtr<ImageEventListener> create(ImageDocument* document) { return adoptRef(new ImageEventListener(document)); }
+ static PassRefPtrWillBeRawPtr<ImageEventListener> create(ImageDocument* document)
+ {
+ return adoptRefWillBeNoop(new ImageEventListener(document));
+ }
static const ImageEventListener* cast(const EventListener* listener)
{
return listener->type() == ImageEventListenerType
@@ -66,6 +69,12 @@ public:
virtual bool operator==(const EventListener& other);
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ visitor->trace(m_doc);
+ EventListener::trace(visitor);
+ }
+
private:
ImageEventListener(ImageDocument* document)
: EventListener(ImageEventListenerType)
@@ -75,7 +84,7 @@ private:
virtual void handleEvent(ExecutionContext*, Event*);
- ImageDocument* m_doc;
+ RawPtrWillBeMember<ImageDocument> m_doc;
};
class ImageDocumentParser : public RawDataDocumentParser {
@@ -227,7 +236,7 @@ void ImageDocument::createDocumentStructure(bool loadingMultipartContent)
if (shouldShrinkToFit()) {
// Add event listeners
- RefPtr<EventListener> listener = ImageEventListener::create(this);
+ RefPtrWillBeRawPtr<EventListener> listener = ImageEventListener::create(this);
if (LocalDOMWindow* domWindow = this->domWindow())
domWindow->addEventListener("resize", listener, false);
if (m_shrinkToFitMode == Desktop)

Powered by Google App Engine
This is Rietveld 408576698