Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Side by Side Diff: Source/core/loader/ImageLoader.h

Issue 1374793005: Single image reload fix (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/forms/ImageInputType.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/forms/ImageInputType.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698