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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class Element; | 54 class Element; |
55 class ImageLoader; | 55 class ImageLoader; |
56 class LayoutImageResource; | 56 class LayoutImageResource; |
57 | 57 |
58 template<typename T> class EventSender; | 58 template<typename T> class EventSender; |
59 typedef EventSender<ImageLoader> ImageEventSender; | 59 typedef EventSender<ImageLoader> ImageEventSender; |
60 | 60 |
61 class CORE_EXPORT ImageLoader : public NoBaseWillBeGarbageCollectedFinalized<Ima
geLoader>, public ImageResourceClient { | 61 class CORE_EXPORT ImageLoader : public NoBaseWillBeGarbageCollectedFinalized<Ima
geLoader>, public ImageResourceClient { |
62 public: | 62 public: |
63 explicit ImageLoader(Element*); | 63 explicit ImageLoader(Element*); |
64 virtual ~ImageLoader(); | 64 ~ImageLoader() override; |
65 | 65 |
66 // We must run the destructor in the eager sweeping phase and call | 66 // We must run the destructor in the eager sweeping phase and call |
67 // m_image->removeClient(this). Otherwise, the ImageResource can invoke | 67 // m_image->removeClient(this). Otherwise, the ImageResource can invoke |
68 // didAddClient() for the ImageLoader that is about to die in the current | 68 // didAddClient() for the ImageLoader that is about to die in the current |
69 // lazy sweeping, and the didAddClient() can access on-heap objects that | 69 // lazy sweeping, and the didAddClient() can access on-heap objects that |
70 // have already been finalized in the current lazy sweeping. | 70 // have already been finalized in the current lazy sweeping. |
71 EAGERLY_FINALIZE(); | 71 EAGERLY_FINALIZE(); |
72 DECLARE_TRACE(); | 72 DECLARE_TRACE(); |
73 | 73 |
74 enum UpdateFromElementBehavior { | 74 enum UpdateFromElementBehavior { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 | 112 |
113 void dispatchPendingEvent(ImageEventSender*); | 113 void dispatchPendingEvent(ImageEventSender*); |
114 | 114 |
115 static void dispatchPendingLoadEvents(); | 115 static void dispatchPendingLoadEvents(); |
116 static void dispatchPendingErrorEvents(); | 116 static void dispatchPendingErrorEvents(); |
117 | 117 |
118 void addClient(ImageLoaderClient*); | 118 void addClient(ImageLoaderClient*); |
119 void removeClient(ImageLoaderClient*); | 119 void removeClient(ImageLoaderClient*); |
120 | 120 |
121 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; | 121 bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) final; |
122 protected: | 122 protected: |
123 virtual void notifyFinished(Resource*) override; | 123 void notifyFinished(Resource*) override; |
124 | 124 |
125 private: | 125 private: |
126 class Task; | 126 class Task; |
127 | 127 |
128 // Called from the task or from updateFromElement to initiate the load. | 128 // Called from the task or from updateFromElement to initiate the load. |
129 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior)
; | 129 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior)
; |
130 | 130 |
131 virtual void dispatchLoadEvent() = 0; | 131 virtual void dispatchLoadEvent() = 0; |
132 virtual void noImageResourceToLoad() { } | 132 virtual void noImageResourceToLoad() { } |
133 | 133 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 bool m_imageComplete : 1; | 192 bool m_imageComplete : 1; |
193 bool m_loadingImageDocument : 1; | 193 bool m_loadingImageDocument : 1; |
194 bool m_elementIsProtected : 1; | 194 bool m_elementIsProtected : 1; |
195 bool m_suppressErrorEvents : 1; | 195 bool m_suppressErrorEvents : 1; |
196 unsigned m_highPriorityClientCount; | 196 unsigned m_highPriorityClientCount; |
197 }; | 197 }; |
198 | 198 |
199 } | 199 } |
200 | 200 |
201 #endif | 201 #endif |
OLD | NEW |