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

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

Issue 2202473002: DO NOT COMMIT: Experimental removal of encoded image data Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 3 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
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // This should be the update behavior when the element is attached to a document, or when DOM mutations trigger a new load. 57 // This should be the update behavior when the element is attached to a document, or when DOM mutations trigger a new load.
58 // Starts loading if a load hasn't already been started. 58 // Starts loading if a load hasn't already been started.
59 UpdateNormal, 59 UpdateNormal,
60 // This should be the update behavior when the resource was changed (via 'src', 'srcset' or 'sizes'). 60 // This should be the update behavior when the resource was changed (via 'src', 'srcset' or 'sizes').
61 // Starts a new load even if a previous load of the same resource have f ailed, to match Firefox's behavior. 61 // Starts a new load even if a previous load of the same resource have f ailed, to match Firefox's behavior.
62 // FIXME - Verify that this is the right behavior according to the spec. 62 // FIXME - Verify that this is the right behavior according to the spec.
63 UpdateIgnorePreviousError, 63 UpdateIgnorePreviousError,
64 // This forces the image to update its intrinsic size, even if the image source has not changed. 64 // This forces the image to update its intrinsic size, even if the image source has not changed.
65 UpdateSizeChanged, 65 UpdateSizeChanged,
66 // This force the image to refetch and reload the image source, even if it has not changed. 66 // This force the image to refetch and reload the image source, even if it has not changed.
67 UpdateForcedReload 67 UpdateForcedReload,
68
69 UpdateMyReload,
68 }; 70 };
69 71
70 enum BypassMainWorldBehavior { 72 enum BypassMainWorldBehavior {
71 BypassMainWorldCSP, 73 BypassMainWorldCSP,
72 DoNotBypassMainWorldCSP 74 DoNotBypassMainWorldCSP
73 }; 75 };
74 76
75 void updateFromElement(UpdateFromElementBehavior = UpdateNormal, ReferrerPol icy = ReferrerPolicyDefault); 77 void updateFromElement(UpdateFromElementBehavior = UpdateNormal, ReferrerPol icy = ReferrerPolicyDefault);
76 78
77 void elementDidMoveToNewDocument(); 79 void elementDidMoveToNewDocument();
(...skipping 23 matching lines...) Expand all
101 { 103 {
102 return !m_failedLoadURL.isEmpty(); 104 return !m_failedLoadURL.isEmpty();
103 } 105 }
104 106
105 void dispatchPendingEvent(ImageEventSender*); 107 void dispatchPendingEvent(ImageEventSender*);
106 108
107 static void dispatchPendingLoadEvents(); 109 static void dispatchPendingLoadEvents();
108 static void dispatchPendingErrorEvents(); 110 static void dispatchPendingErrorEvents();
109 111
110 bool getImageAnimationPolicy(ImageAnimationPolicy&) final; 112 bool getImageAnimationPolicy(ImageAnimationPolicy&) final;
113
114 void requireReloading() override;
115
111 protected: 116 protected:
112 void imageNotifyFinished(ImageResource*) override; 117 void imageNotifyFinished(ImageResource*) override;
113 118
114 private: 119 private:
115 class Task; 120 class Task;
116 121
117 // Called from the task or from updateFromElement to initiate the load. 122 // Called from the task or from updateFromElement to initiate the load.
118 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior, const KURL&, ReferrerPolicy = ReferrerPolicyDefault); 123 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior, const KURL&, ReferrerPolicy = ReferrerPolicyDefault);
119 124
120 virtual void dispatchLoadEvent() = 0; 125 virtual void dispatchLoadEvent() = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 Timer<ImageLoader> m_derefElementTimer; 164 Timer<ImageLoader> m_derefElementTimer;
160 AtomicString m_failedLoadURL; 165 AtomicString m_failedLoadURL;
161 WeakPtr<Task> m_pendingTask; // owned by Microtask 166 WeakPtr<Task> m_pendingTask; // owned by Microtask
162 std::unique_ptr<IncrementLoadEventDelayCount> m_loadDelayCounter; 167 std::unique_ptr<IncrementLoadEventDelayCount> m_loadDelayCounter;
163 bool m_hasPendingLoadEvent : 1; 168 bool m_hasPendingLoadEvent : 1;
164 bool m_hasPendingErrorEvent : 1; 169 bool m_hasPendingErrorEvent : 1;
165 bool m_imageComplete : 1; 170 bool m_imageComplete : 1;
166 bool m_loadingImageDocument : 1; 171 bool m_loadingImageDocument : 1;
167 bool m_elementIsProtected : 1; 172 bool m_elementIsProtected : 1;
168 bool m_suppressErrorEvents : 1; 173 bool m_suppressErrorEvents : 1;
174 bool m_suppressEvents : 1;
169 }; 175 };
170 176
171 } // namespace blink 177 } // namespace blink
172 178
173 #endif 179 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLDocument.cpp ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698