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

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

Issue 1291613010: Implement referrerpolicy attribute for img elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: actually fix webexposed test this time Created 5 years, 4 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/parser/PreloadRequest.h ('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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/parser/PreloadRequest.h ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698