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/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/ImageResourceObserver.h" |
| 29 #include "core/fetch/ResourceClient.h" |
29 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
30 #include "wtf/HashSet.h" | 31 #include "wtf/HashSet.h" |
31 #include "wtf/WeakPtr.h" | 32 #include "wtf/WeakPtr.h" |
32 #include "wtf/text/AtomicString.h" | 33 #include "wtf/text/AtomicString.h" |
33 | 34 |
34 namespace blink { | 35 namespace blink { |
35 | 36 |
36 class IncrementLoadEventDelayCount; | 37 class IncrementLoadEventDelayCount; |
37 class FetchRequest; | 38 class FetchRequest; |
38 class Document; | 39 class Document; |
(...skipping 11 matching lines...) Expand all Loading... |
50 ImageLoaderClient() { } | 51 ImageLoaderClient() { } |
51 }; | 52 }; |
52 | 53 |
53 class Element; | 54 class Element; |
54 class ImageLoader; | 55 class ImageLoader; |
55 class LayoutImageResource; | 56 class LayoutImageResource; |
56 | 57 |
57 template<typename T> class EventSender; | 58 template<typename T> class EventSender; |
58 using ImageEventSender = EventSender<ImageLoader>; | 59 using ImageEventSender = EventSender<ImageLoader>; |
59 | 60 |
60 class CORE_EXPORT ImageLoader : public NoBaseWillBeGarbageCollectedFinalized<Ima
geLoader>, public ImageResourceClient { | 61 class CORE_EXPORT ImageLoader : public NoBaseWillBeGarbageCollectedFinalized<Ima
geLoader>, public ResourceClient, public ImageResourceObserver { |
61 WILL_BE_USING_PRE_FINALIZER(ImageLoader, dispose); | 62 WILL_BE_USING_PRE_FINALIZER(ImageLoader, dispose); |
62 USING_FAST_MALLOC_WILL_BE_REMOVED(ImageLoader); | 63 USING_FAST_MALLOC_WILL_BE_REMOVED(ImageLoader); |
63 public: | 64 public: |
64 explicit ImageLoader(Element*); | 65 explicit ImageLoader(Element*); |
65 ~ImageLoader() override; | 66 ~ImageLoader() override; |
66 | 67 |
67 DECLARE_TRACE(); | 68 DECLARE_TRACE(); |
68 | 69 |
69 enum UpdateFromElementBehavior { | 70 enum UpdateFromElementBehavior { |
70 // This should be the update behavior when the element is attached to a
document, or when DOM mutations trigger a new load. | 71 // This should be the update behavior when the element is attached to a
document, or when DOM mutations trigger a new load. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool hasPendingError() const | 109 bool hasPendingError() const |
109 { | 110 { |
110 return m_hasPendingErrorEvent; | 111 return m_hasPendingErrorEvent; |
111 } | 112 } |
112 | 113 |
113 void dispatchPendingEvent(ImageEventSender*); | 114 void dispatchPendingEvent(ImageEventSender*); |
114 | 115 |
115 static void dispatchPendingLoadEvents(); | 116 static void dispatchPendingLoadEvents(); |
116 static void dispatchPendingErrorEvents(); | 117 static void dispatchPendingErrorEvents(); |
117 | 118 |
118 bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) final; | 119 bool getImageAnimationPolicy(ImageAnimationPolicy&) final; |
119 protected: | 120 protected: |
120 void notifyFinished(Resource*) override; | 121 void notifyFinished(Resource*) override; |
121 | 122 |
122 private: | 123 private: |
123 class Task; | 124 class Task; |
124 | 125 |
125 // Called from the task or from updateFromElement to initiate the load. | 126 // Called from the task or from updateFromElement to initiate the load. |
126 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior,
ReferrerPolicy = ReferrerPolicyDefault); | 127 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior,
ReferrerPolicy = ReferrerPolicyDefault); |
127 | 128 |
128 virtual void dispatchLoadEvent() = 0; | 129 virtual void dispatchLoadEvent() = 0; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool m_imageComplete : 1; | 183 bool m_imageComplete : 1; |
183 bool m_loadingImageDocument : 1; | 184 bool m_loadingImageDocument : 1; |
184 bool m_elementIsProtected : 1; | 185 bool m_elementIsProtected : 1; |
185 bool m_suppressErrorEvents : 1; | 186 bool m_suppressErrorEvents : 1; |
186 unsigned m_highPriorityClientCount; | 187 unsigned m_highPriorityClientCount; |
187 }; | 188 }; |
188 | 189 |
189 } // namespace blink | 190 } // namespace blink |
190 | 191 |
191 #endif | 192 #endif |
OLD | NEW |