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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 UpdateSizeChanged, | 78 UpdateSizeChanged, |
79 // This force the image to refetch and reload the image source, even if
it has not changed. | 79 // This force the image to refetch and reload the image source, even if
it has not changed. |
80 UpdateForcedReload | 80 UpdateForcedReload |
81 }; | 81 }; |
82 | 82 |
83 enum BypassMainWorldBehavior { | 83 enum BypassMainWorldBehavior { |
84 BypassMainWorldCSP, | 84 BypassMainWorldCSP, |
85 DoNotBypassMainWorldCSP | 85 DoNotBypassMainWorldCSP |
86 }; | 86 }; |
87 | 87 |
88 void updateFromElement(UpdateFromElementBehavior = UpdateNormal); | 88 void updateFromElement(UpdateFromElementBehavior = UpdateNormal, ReferrerPol
icy = ReferrerPolicyDefault); |
89 | 89 |
90 void elementDidMoveToNewDocument(); | 90 void elementDidMoveToNewDocument(); |
91 | 91 |
92 Element* element() const { return m_element; } | 92 Element* element() const { return m_element; } |
93 bool imageComplete() const | 93 bool imageComplete() const |
94 { | 94 { |
95 return m_imageComplete && !m_pendingTask; | 95 return m_imageComplete && !m_pendingTask; |
96 } | 96 } |
97 | 97 |
98 ImageResource* image() const { return m_image.get(); } | 98 ImageResource* image() const { return m_image.get(); } |
(...skipping 15 matching lines...) Expand all Loading... |
114 void removeClient(ImageLoaderClient*); | 114 void removeClient(ImageLoaderClient*); |
115 | 115 |
116 bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) final; | 116 bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) final; |
117 protected: | 117 protected: |
118 void notifyFinished(Resource*) override; | 118 void notifyFinished(Resource*) override; |
119 | 119 |
120 private: | 120 private: |
121 class Task; | 121 class Task; |
122 | 122 |
123 // Called from the task or from updateFromElement to initiate the load. | 123 // Called from the task or from updateFromElement to initiate the load. |
124 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior)
; | 124 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior,
ReferrerPolicy = ReferrerPolicyDefault); |
125 | 125 |
126 virtual void dispatchLoadEvent() = 0; | 126 virtual void dispatchLoadEvent() = 0; |
127 virtual void noImageResourceToLoad() { } | 127 virtual void noImageResourceToLoad() { } |
128 | 128 |
129 void updatedHasPendingEvent(); | 129 void updatedHasPendingEvent(); |
130 | 130 |
131 void dispatchPendingLoadEvent(); | 131 void dispatchPendingLoadEvent(); |
132 void dispatchPendingErrorEvent(); | 132 void dispatchPendingErrorEvent(); |
133 | 133 |
134 LayoutImageResource* layoutImageResource(); | 134 LayoutImageResource* layoutImageResource(); |
135 void updateLayoutObject(); | 135 void updateLayoutObject(); |
136 | 136 |
137 void setImageWithoutConsideringPendingLoadEvent(ImageResource*); | 137 void setImageWithoutConsideringPendingLoadEvent(ImageResource*); |
138 void sourceImageChanged(); | 138 void sourceImageChanged(); |
139 void clearFailedLoadURL(); | 139 void clearFailedLoadURL(); |
140 void dispatchErrorEvent(); | 140 void dispatchErrorEvent(); |
141 void crossSiteOrCSPViolationOccurred(AtomicString); | 141 void crossSiteOrCSPViolationOccurred(AtomicString); |
142 void enqueueImageLoadingMicroTask(UpdateFromElementBehavior); | 142 void enqueueImageLoadingMicroTask(UpdateFromElementBehavior, ReferrerPolicy)
; |
143 | 143 |
144 void timerFired(Timer<ImageLoader>*); | 144 void timerFired(Timer<ImageLoader>*); |
145 | 145 |
146 KURL imageSourceToKURL(AtomicString) const; | 146 KURL imageSourceToKURL(AtomicString) const; |
147 | 147 |
148 // Used to determine whether to immediately initiate the load | 148 // Used to determine whether to immediately initiate the load |
149 // or to schedule a microtask. | 149 // or to schedule a microtask. |
150 bool shouldLoadImmediately(const KURL&) const; | 150 bool shouldLoadImmediately(const KURL&) const; |
151 | 151 |
152 void willRemoveClient(ImageLoaderClient&); | 152 void willRemoveClient(ImageLoaderClient&); |
(...skipping 27 matching lines...) Expand all Loading... |
180 bool m_imageComplete : 1; | 180 bool m_imageComplete : 1; |
181 bool m_loadingImageDocument : 1; | 181 bool m_loadingImageDocument : 1; |
182 bool m_elementIsProtected : 1; | 182 bool m_elementIsProtected : 1; |
183 bool m_suppressErrorEvents : 1; | 183 bool m_suppressErrorEvents : 1; |
184 unsigned m_highPriorityClientCount; | 184 unsigned m_highPriorityClientCount; |
185 }; | 185 }; |
186 | 186 |
187 } | 187 } |
188 | 188 |
189 #endif | 189 #endif |
OLD | NEW |