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

Side by Side Diff: third_party/WebKit/Source/core/loader/ImageLoader.h

Issue 2344563002: Remove the lifetime hack in ImageLoader where it keeps its assoc element alive
Patch Set: fix Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 LayoutImageResource* layoutImageResource(); 128 LayoutImageResource* layoutImageResource();
129 void updateLayoutObject(); 129 void updateLayoutObject();
130 130
131 void setImageWithoutConsideringPendingLoadEvent(ImageResource*); 131 void setImageWithoutConsideringPendingLoadEvent(ImageResource*);
132 void clearFailedLoadURL(); 132 void clearFailedLoadURL();
133 void dispatchErrorEvent(); 133 void dispatchErrorEvent();
134 void crossSiteOrCSPViolationOccurred(AtomicString); 134 void crossSiteOrCSPViolationOccurred(AtomicString);
135 void enqueueImageLoadingMicroTask(UpdateFromElementBehavior, ReferrerPolicy) ; 135 void enqueueImageLoadingMicroTask(UpdateFromElementBehavior, ReferrerPolicy) ;
136 136
137 void timerFired(TimerBase*);
138
139 KURL imageSourceToKURL(AtomicString) const; 137 KURL imageSourceToKURL(AtomicString) const;
140 138
141 // Used to determine whether to immediately initiate the load 139 // Used to determine whether to immediately initiate the load
142 // or to schedule a microtask. 140 // or to schedule a microtask.
143 bool shouldLoadImmediately(const KURL&) const; 141 bool shouldLoadImmediately(const KURL&) const;
144 142
145 // For Oilpan, we must run dispose() as a prefinalizer and call 143 // For Oilpan, we must run dispose() as a prefinalizer and call
146 // m_image->removeClient(this) (and more.) Otherwise, the ImageResource can invoke 144 // m_image->removeClient(this) (and more.) Otherwise, the ImageResource can invoke
147 // didAddClient() for the ImageLoader that is about to die in the current 145 // didAddClient() for the ImageLoader that is about to die in the current
148 // lazy sweeping, and the didAddClient() can access on-heap objects that 146 // lazy sweeping, and the didAddClient() can access on-heap objects that
149 // have already been finalized in the current lazy sweeping. 147 // have already been finalized in the current lazy sweeping.
150 void dispose(); 148 void dispose();
151 149
152 Member<Element> m_element; 150 Member<Element> m_element;
153 Member<ImageResource> m_image; 151 Member<ImageResource> m_image;
154 // FIXME: Oilpan: We might be able to remove this Persistent hack when
155 // ImageResourceClient is traceable.
156 GC_PLUGIN_IGNORE("http://crbug.com/383741")
157 Persistent<Element> m_keepAlive;
158 152
159 Timer<ImageLoader> m_derefElementTimer;
160 AtomicString m_failedLoadURL; 153 AtomicString m_failedLoadURL;
161 WeakPtr<Task> m_pendingTask; // owned by Microtask 154 WeakPtr<Task> m_pendingTask; // owned by Microtask
162 std::unique_ptr<IncrementLoadEventDelayCount> m_loadDelayCounter; 155 std::unique_ptr<IncrementLoadEventDelayCount> m_loadDelayCounter;
163 bool m_hasPendingLoadEvent : 1; 156 bool m_hasPendingLoadEvent : 1;
164 bool m_hasPendingErrorEvent : 1; 157 bool m_hasPendingErrorEvent : 1;
165 bool m_imageComplete : 1; 158 bool m_imageComplete : 1;
166 bool m_loadingImageDocument : 1; 159 bool m_loadingImageDocument : 1;
167 bool m_elementIsProtected : 1;
168 bool m_suppressErrorEvents : 1; 160 bool m_suppressErrorEvents : 1;
169 }; 161 };
170 162
171 } // namespace blink 163 } // namespace blink
172 164
173 #endif 165 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698