| 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 19 matching lines...) Expand all Loading... |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/HashSet.h" | 31 #include "wtf/HashSet.h" |
| 32 #include "wtf/WeakPtr.h" | 32 #include "wtf/WeakPtr.h" |
| 33 #include "wtf/text/AtomicString.h" | 33 #include "wtf/text/AtomicString.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class IncrementLoadEventDelayCount; | 37 class IncrementLoadEventDelayCount; |
| 38 class FetchRequest; | 38 class FetchRequest; |
| 39 class Document; | 39 class Document; |
| 40 class WebURLRequest; |
| 40 | 41 |
| 41 class CORE_EXPORT ImageLoaderClient : public WillBeGarbageCollectedMixin { | 42 class CORE_EXPORT ImageLoaderClient : public WillBeGarbageCollectedMixin { |
| 42 public: | 43 public: |
| 43 virtual void notifyImageSourceChanged() = 0; | 44 virtual void notifyImageSourceChanged() = 0; |
| 44 | 45 |
| 45 // Determines whether the observed ImageResource should have higher priority
in the decoded resources cache. | 46 // Determines whether the observed ImageResource should have higher priority
in the decoded resources cache. |
| 46 virtual bool requestsHighLiveResourceCachePriority() { return false; } | 47 virtual bool requestsHighLiveResourceCachePriority() { return false; } |
| 47 | 48 |
| 48 DEFINE_INLINE_VIRTUAL_TRACE() { } | 49 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 49 | 50 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 UpdateSizeChanged, | 80 UpdateSizeChanged, |
| 80 // This force the image to refetch and reload the image source, even if
it has not changed. | 81 // This force the image to refetch and reload the image source, even if
it has not changed. |
| 81 UpdateForcedReload | 82 UpdateForcedReload |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 enum BypassMainWorldBehavior { | 85 enum BypassMainWorldBehavior { |
| 85 BypassMainWorldCSP, | 86 BypassMainWorldCSP, |
| 86 DoNotBypassMainWorldCSP | 87 DoNotBypassMainWorldCSP |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 void updateFromElement(UpdateFromElementBehavior = UpdateNormal, ReferrerPol
icy = ReferrerPolicyDefault); | 90 void updateFromElement(WebURLRequest::ExtraData*, UpdateFromElementBehavior
= UpdateNormal, ReferrerPolicy = ReferrerPolicyDefault); |
| 90 | 91 |
| 91 void elementDidMoveToNewDocument(); | 92 void elementDidMoveToNewDocument(); |
| 92 | 93 |
| 93 Element* element() const { return m_element; } | 94 Element* element() const { return m_element; } |
| 94 bool imageComplete() const | 95 bool imageComplete() const |
| 95 { | 96 { |
| 96 return m_imageComplete && !m_pendingTask; | 97 return m_imageComplete && !m_pendingTask; |
| 97 } | 98 } |
| 98 | 99 |
| 99 ImageResource* image() const { return m_image.get(); } | 100 ImageResource* image() const { return m_image.get(); } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 115 void removeClient(ImageLoaderClient*); | 116 void removeClient(ImageLoaderClient*); |
| 116 | 117 |
| 117 bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) final; | 118 bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) final; |
| 118 protected: | 119 protected: |
| 119 void notifyFinished(Resource*) override; | 120 void notifyFinished(Resource*) override; |
| 120 | 121 |
| 121 private: | 122 private: |
| 122 class Task; | 123 class Task; |
| 123 | 124 |
| 124 // Called from the task or from updateFromElement to initiate the load. | 125 // Called from the task or from updateFromElement to initiate the load. |
| 125 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior,
ReferrerPolicy = ReferrerPolicyDefault); | 126 void doUpdateFromElement(WebURLRequest::ExtraData*, BypassMainWorldBehavior,
UpdateFromElementBehavior, ReferrerPolicy = ReferrerPolicyDefault); |
| 126 | 127 |
| 127 virtual void dispatchLoadEvent() = 0; | 128 virtual void dispatchLoadEvent() = 0; |
| 128 virtual void noImageResourceToLoad() { } | 129 virtual void noImageResourceToLoad() { } |
| 129 | 130 |
| 130 void updatedHasPendingEvent(); | 131 void updatedHasPendingEvent(); |
| 131 | 132 |
| 132 void dispatchPendingLoadEvent(); | 133 void dispatchPendingLoadEvent(); |
| 133 void dispatchPendingErrorEvent(); | 134 void dispatchPendingErrorEvent(); |
| 134 | 135 |
| 135 LayoutImageResource* layoutImageResource(); | 136 LayoutImageResource* layoutImageResource(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 bool m_imageComplete : 1; | 182 bool m_imageComplete : 1; |
| 182 bool m_loadingImageDocument : 1; | 183 bool m_loadingImageDocument : 1; |
| 183 bool m_elementIsProtected : 1; | 184 bool m_elementIsProtected : 1; |
| 184 bool m_suppressErrorEvents : 1; | 185 bool m_suppressErrorEvents : 1; |
| 185 unsigned m_highPriorityClientCount; | 186 unsigned m_highPriorityClientCount; |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 } | 189 } |
| 189 | 190 |
| 190 #endif | 191 #endif |
| OLD | NEW |