Chromium Code Reviews| 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 * |
| 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/fetch/ImageResource.h" | 26 #include "core/fetch/ImageResource.h" |
| 27 #include "core/fetch/ImageResourceClient.h" | 27 #include "core/fetch/ImageResourceClient.h" |
| 28 #include "core/fetch/ResourcePtr.h" | 28 #include "core/fetch/ResourcePtr.h" |
| 29 #include "heap/Handle.h" | |
| 29 #include "wtf/HashSet.h" | 30 #include "wtf/HashSet.h" |
| 30 #include "wtf/text/AtomicString.h" | 31 #include "wtf/text/AtomicString.h" |
| 31 | 32 |
| 32 namespace WebCore { | 33 namespace WebCore { |
| 33 | 34 |
| 34 class ImageLoaderClient { | 35 class ImageLoaderClient : public WillBeGarbageCollectedMixin { |
| 35 public: | 36 public: |
| 36 virtual void notifyImageSourceChanged() = 0; | 37 virtual void notifyImageSourceChanged() = 0; |
| 37 | 38 |
| 38 // Determines whether the observed ImageResource should have higher priority in the decoded resources cache. | 39 // Determines whether the observed ImageResource should have higher priority in the decoded resources cache. |
| 39 virtual bool requestsHighLiveResourceCachePriority() { return false; } | 40 virtual bool requestsHighLiveResourceCachePriority() { return false; } |
| 40 | 41 |
| 42 virtual void trace(Visitor*) = 0; | |
| 43 | |
| 41 protected: | 44 protected: |
| 42 ImageLoaderClient() { } | 45 ImageLoaderClient() { } |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 class Element; | 48 class Element; |
| 46 class ImageLoader; | 49 class ImageLoader; |
| 47 class RenderImageResource; | 50 class RenderImageResource; |
| 48 | 51 |
| 49 template<typename T> class EventSender; | 52 template<typename T> class EventSender; |
| 50 typedef EventSender<ImageLoader> ImageEventSender; | 53 typedef EventSender<ImageLoader> ImageEventSender; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 102 |
| 100 RenderImageResource* renderImageResource(); | 103 RenderImageResource* renderImageResource(); |
| 101 void updateRenderer(); | 104 void updateRenderer(); |
| 102 | 105 |
| 103 void setImageWithoutConsideringPendingLoadEvent(ImageResource*); | 106 void setImageWithoutConsideringPendingLoadEvent(ImageResource*); |
| 104 void sourceImageChanged(); | 107 void sourceImageChanged(); |
| 105 void clearFailedLoadURL(); | 108 void clearFailedLoadURL(); |
| 106 | 109 |
| 107 void timerFired(Timer<ImageLoader>*); | 110 void timerFired(Timer<ImageLoader>*); |
| 108 | 111 |
| 112 typedef WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<ImageLoaderClient > > ImageLoaderClientSet; | |
|
haraken
2014/03/13 01:22:28
Can't you use WillBeHeapHashSet<RawPtrWillBeWeakMe
sof
2014/03/13 06:14:37
At some point, hopefully. This is in ImageLoader (
| |
| 113 | |
| 109 Element* m_element; | 114 Element* m_element; |
| 110 ResourcePtr<ImageResource> m_image; | 115 ResourcePtr<ImageResource> m_image; |
| 111 HashSet<ImageLoaderClient*> m_clients; | 116 ImageLoaderClientSet m_clients; |
| 112 Timer<ImageLoader> m_derefElementTimer; | 117 Timer<ImageLoader> m_derefElementTimer; |
| 113 AtomicString m_failedLoadURL; | 118 AtomicString m_failedLoadURL; |
| 114 bool m_hasPendingBeforeLoadEvent : 1; | 119 bool m_hasPendingBeforeLoadEvent : 1; |
| 115 bool m_hasPendingLoadEvent : 1; | 120 bool m_hasPendingLoadEvent : 1; |
| 116 bool m_hasPendingErrorEvent : 1; | 121 bool m_hasPendingErrorEvent : 1; |
| 117 bool m_imageComplete : 1; | 122 bool m_imageComplete : 1; |
| 118 bool m_loadManually : 1; | 123 bool m_loadManually : 1; |
| 119 bool m_elementIsProtected : 1; | 124 bool m_elementIsProtected : 1; |
| 120 unsigned m_highPriorityClientCount; | 125 unsigned m_highPriorityClientCount; |
| 121 }; | 126 }; |
| 122 | 127 |
| 123 } | 128 } |
| 124 | 129 |
| 125 #endif | 130 #endif |
| OLD | NEW |