| OLD | NEW |
| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 KURL imageSourceToKURL(AtomicString) const; | 137 KURL imageSourceToKURL(AtomicString) const; |
| 138 | 138 |
| 139 // Used to determine whether to immediately initiate the load | 139 // Used to determine whether to immediately initiate the load |
| 140 // or to schedule a microtask. | 140 // or to schedule a microtask. |
| 141 bool shouldLoadImmediately(const KURL&, LoadType) const; | 141 bool shouldLoadImmediately(const KURL&, LoadType) const; |
| 142 | 142 |
| 143 void willRemoveClient(ImageLoaderClient&); | 143 void willRemoveClient(ImageLoaderClient&); |
| 144 | 144 |
| 145 RawPtr<Element> m_element; | 145 RawPtr<Element> m_element; |
| 146 ResourcePtr<ImageResource> m_image; | 146 ResourcePtr<ImageResource> m_image; |
| 147 // FIXME: Oilpan: We might be able to remove this Persistent hack when | |
| 148 // ImageResourceClient is traceable. | |
| 149 GC_PLUGIN_IGNORE("http://crbug.com/383741") | |
| 150 RefPtr<Element> m_keepAlive; | 147 RefPtr<Element> m_keepAlive; |
| 151 #if ENABLE(OILPAN) | |
| 152 class ImageLoaderClientRemover { | |
| 153 public: | |
| 154 ImageLoaderClientRemover(ImageLoader& loader, ImageLoaderClient& client)
: m_loader(loader), m_client(client) { } | |
| 155 ~ImageLoaderClientRemover(); | |
| 156 | |
| 157 private: | |
| 158 ImageLoader& m_loader; | |
| 159 ImageLoaderClient& m_client; | |
| 160 }; | |
| 161 friend class ImageLoaderClientRemover; | |
| 162 // Oilpan: This ImageLoader object must outlive its clients because they | |
| 163 // need to call ImageLoader::willRemoveClient before they | |
| 164 // die. Non-Persistent HeapHashMap doesn't work well because weak processing | |
| 165 // for HeapHashMap is not triggered when both of ImageLoader and | |
| 166 // ImageLoaderClient are unreachable. | |
| 167 GC_PLUGIN_IGNORE("http://crbug.com/383742") | |
| 168 PersistentHeapHashMap<WeakMember<ImageLoaderClient>, OwnPtr<ImageLoaderClien
tRemover> > m_clients; | |
| 169 #else | |
| 170 HashSet<ImageLoaderClient*> m_clients; | 148 HashSet<ImageLoaderClient*> m_clients; |
| 171 #endif | |
| 172 Timer<ImageLoader> m_derefElementTimer; | 149 Timer<ImageLoader> m_derefElementTimer; |
| 173 AtomicString m_failedLoadURL; | 150 AtomicString m_failedLoadURL; |
| 174 WeakPtr<Task> m_pendingTask; // owned by Microtask | 151 WeakPtr<Task> m_pendingTask; // owned by Microtask |
| 175 OwnPtr<IncrementLoadEventDelayCount> m_loadDelayCounter; | 152 OwnPtr<IncrementLoadEventDelayCount> m_loadDelayCounter; |
| 176 bool m_hasPendingLoadEvent : 1; | 153 bool m_hasPendingLoadEvent : 1; |
| 177 bool m_hasPendingErrorEvent : 1; | 154 bool m_hasPendingErrorEvent : 1; |
| 178 bool m_imageComplete : 1; | 155 bool m_imageComplete : 1; |
| 179 bool m_elementIsProtected : 1; | 156 bool m_elementIsProtected : 1; |
| 180 unsigned m_highPriorityClientCount; | 157 unsigned m_highPriorityClientCount; |
| 181 }; | 158 }; |
| 182 | 159 |
| 183 } | 160 } |
| 184 | 161 |
| 185 #endif | 162 #endif |
| OLD | NEW |