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

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

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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
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 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 * 20 *
21 */ 21 */
22 22
23 #ifndef ImageLoader_h 23 #ifndef ImageLoader_h
24 #define ImageLoader_h 24 #define ImageLoader_h
25 25
26 #include "core/CoreExport.h" 26 #include "core/CoreExport.h"
27 #include "core/fetch/ImageResource.h" 27 #include "core/fetch/ImageResource.h"
28 #include "core/fetch/ImageResourceClient.h" 28 #include "core/fetch/ImageResourceClient.h"
29 #include "core/fetch/ResourcePtr.h"
30 #include "platform/heap/Handle.h" 29 #include "platform/heap/Handle.h"
31 #include "wtf/HashSet.h" 30 #include "wtf/HashSet.h"
32 #include "wtf/WeakPtr.h" 31 #include "wtf/WeakPtr.h"
33 #include "wtf/text/AtomicString.h" 32 #include "wtf/text/AtomicString.h"
34 33
35 namespace blink { 34 namespace blink {
36 35
37 class IncrementLoadEventDelayCount; 36 class IncrementLoadEventDelayCount;
38 class FetchRequest; 37 class FetchRequest;
39 class Document; 38 class Document;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // didAddClient() for the ImageLoader that is about to die in the current 161 // didAddClient() for the ImageLoader that is about to die in the current
163 // lazy sweeping, and the didAddClient() can access on-heap objects that 162 // lazy sweeping, and the didAddClient() can access on-heap objects that
164 // have already been finalized in the current lazy sweeping. 163 // have already been finalized in the current lazy sweeping.
165 void dispose(); 164 void dispose();
166 165
167 #if ENABLE(OILPAN) 166 #if ENABLE(OILPAN)
168 void clearWeakMembers(Visitor*); 167 void clearWeakMembers(Visitor*);
169 #endif 168 #endif
170 169
171 RawPtrWillBeMember<Element> m_element; 170 RawPtrWillBeMember<Element> m_element;
172 ResourcePtr<ImageResource> m_image; 171 RefPtrWillBeMember<ImageResource> m_image;
173 // FIXME: Oilpan: We might be able to remove this Persistent hack when 172 // FIXME: Oilpan: We might be able to remove this Persistent hack when
174 // ImageResourceClient is traceable. 173 // ImageResourceClient is traceable.
175 GC_PLUGIN_IGNORE("http://crbug.com/383741") 174 GC_PLUGIN_IGNORE("http://crbug.com/383741")
176 RefPtrWillBePersistent<Element> m_keepAlive; 175 RefPtrWillBePersistent<Element> m_keepAlive;
177 176
178 // Oilpan: the client references are weak, and managed as such via clearWeak Members(); 177 // Oilpan: the client references are weak, and managed as such via clearWeak Members();
179 HashSet<RawPtrWillBeUntracedMember<ImageLoaderClient>> m_clients; 178 HashSet<RawPtrWillBeUntracedMember<ImageLoaderClient>> m_clients;
180 Timer<ImageLoader> m_derefElementTimer; 179 Timer<ImageLoader> m_derefElementTimer;
181 AtomicString m_failedLoadURL; 180 AtomicString m_failedLoadURL;
182 WeakPtr<Task> m_pendingTask; // owned by Microtask 181 WeakPtr<Task> m_pendingTask; // owned by Microtask
183 OwnPtr<IncrementLoadEventDelayCount> m_loadDelayCounter; 182 OwnPtr<IncrementLoadEventDelayCount> m_loadDelayCounter;
184 bool m_hasPendingLoadEvent : 1; 183 bool m_hasPendingLoadEvent : 1;
185 bool m_hasPendingErrorEvent : 1; 184 bool m_hasPendingErrorEvent : 1;
186 bool m_imageComplete : 1; 185 bool m_imageComplete : 1;
187 bool m_loadingImageDocument : 1; 186 bool m_loadingImageDocument : 1;
188 bool m_elementIsProtected : 1; 187 bool m_elementIsProtected : 1;
189 bool m_suppressErrorEvents : 1; 188 bool m_suppressErrorEvents : 1;
190 unsigned m_highPriorityClientCount; 189 unsigned m_highPriorityClientCount;
191 }; 190 };
192 191
193 } // namespace blink 192 } // namespace blink
194 193
195 #endif 194 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698