OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef FrameFetchContext_h | 31 #ifndef FrameFetchContext_h |
32 #define FrameFetchContext_h | 32 #define FrameFetchContext_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "core/fetch/FetchContext.h" | 35 #include "core/fetch/FetchContext.h" |
| 36 #include "core/fetch/FetchRequest.h" |
36 #include "core/fetch/ResourceFetcher.h" | 37 #include "core/fetch/ResourceFetcher.h" |
37 #include "core/frame/csp/ContentSecurityPolicy.h" | 38 #include "core/frame/csp/ContentSecurityPolicy.h" |
38 #include "core/loader/LinkLoader.h" | 39 #include "core/loader/LinkLoader.h" |
39 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
40 #include "platform/network/ResourceRequest.h" | 41 #include "platform/network/ResourceRequest.h" |
41 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
| 46 class ClientHintsPreferences; |
45 class Document; | 47 class Document; |
46 class DocumentLoader; | 48 class DocumentLoader; |
47 class LocalFrame; | 49 class LocalFrame; |
48 class ResourceError; | 50 class ResourceError; |
49 class ResourceResponse; | 51 class ResourceResponse; |
50 | 52 |
51 class CORE_EXPORT FrameFetchContext final : public FetchContext { | 53 class CORE_EXPORT FrameFetchContext final : public FetchContext { |
52 public: | 54 public: |
53 static ResourceFetcher* createFetcherFromDocumentLoader( | 55 static ResourceFetcher* createFetcherFromDocumentLoader( |
54 DocumentLoader* loader) { | 56 DocumentLoader* loader) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 140 |
139 bool isMainFrame() const override; | 141 bool isMainFrame() const override; |
140 bool defersLoading() const override; | 142 bool defersLoading() const override; |
141 bool isLoadComplete() const override; | 143 bool isLoadComplete() const override; |
142 bool pageDismissalEventBeingDispatched() const override; | 144 bool pageDismissalEventBeingDispatched() const override; |
143 bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; | 145 bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; |
144 void sendImagePing(const KURL&) override; | 146 void sendImagePing(const KURL&) override; |
145 void addConsoleMessage(const String&, | 147 void addConsoleMessage(const String&, |
146 LogMessageType = LogErrorMessage) const override; | 148 LogMessageType = LogErrorMessage) const override; |
147 SecurityOrigin* getSecurityOrigin() const override; | 149 SecurityOrigin* getSecurityOrigin() const override; |
148 void modifyRequestForCSP(ResourceRequest&) override; | 150 |
149 void addClientHintsIfNecessary(FetchRequest&) override; | 151 void populateResourceRequest(Resource::Type, |
150 void addCSPHeaderIfNecessary(Resource::Type, FetchRequest&) override; | 152 const ClientHintsPreferences&, |
151 void populateRequestData(ResourceRequest&) override; | 153 const FetchRequest::ResourceWidth&, |
| 154 ResourceRequest&) override; |
| 155 void setFirstPartyCookieAndRequestorOrigin(ResourceRequest&) override; |
| 156 |
| 157 // Exposed for testing. |
| 158 void modifyRequestForCSP(ResourceRequest&); |
| 159 void addClientHintsIfNecessary(const ClientHintsPreferences&, |
| 160 const FetchRequest::ResourceWidth&, |
| 161 ResourceRequest&); |
152 | 162 |
153 MHTMLArchive* archive() const override; | 163 MHTMLArchive* archive() const override; |
154 | 164 |
155 ResourceLoadPriority modifyPriorityForExperiments( | 165 ResourceLoadPriority modifyPriorityForExperiments( |
156 ResourceLoadPriority) override; | 166 ResourceLoadPriority) override; |
157 | 167 |
158 WebTaskRunner* loadingTaskRunner() const override; | 168 WebTaskRunner* loadingTaskRunner() const override; |
159 | 169 |
160 DECLARE_VIRTUAL_TRACE(); | 170 DECLARE_VIRTUAL_TRACE(); |
161 | 171 |
(...skipping 15 matching lines...) Expand all Loading... |
177 | 187 |
178 void prepareRequest(ResourceRequest&); | 188 void prepareRequest(ResourceRequest&); |
179 | 189 |
180 void dispatchDidReceiveResponseInternal(unsigned long identifier, | 190 void dispatchDidReceiveResponseInternal(unsigned long identifier, |
181 const ResourceResponse&, | 191 const ResourceResponse&, |
182 WebURLRequest::FrameType, | 192 WebURLRequest::FrameType, |
183 WebURLRequest::RequestContext, | 193 WebURLRequest::RequestContext, |
184 Resource*, | 194 Resource*, |
185 LinkLoader::CanLoadResources); | 195 LinkLoader::CanLoadResources); |
186 | 196 |
| 197 void addCSPHeaderIfNecessary(Resource::Type, ResourceRequest&); |
| 198 |
187 // FIXME: Oilpan: Ideally this should just be a traced Member but that will | 199 // FIXME: Oilpan: Ideally this should just be a traced Member but that will |
188 // currently leak because ComputedStyle and its data are not on the heap. | 200 // currently leak because ComputedStyle and its data are not on the heap. |
189 // See crbug.com/383860 for details. | 201 // See crbug.com/383860 for details. |
190 WeakMember<Document> m_document; | 202 WeakMember<Document> m_document; |
191 Member<DocumentLoader> m_documentLoader; | 203 Member<DocumentLoader> m_documentLoader; |
192 }; | 204 }; |
193 | 205 |
194 } // namespace blink | 206 } // namespace blink |
195 | 207 |
196 #endif | 208 #endif |
OLD | NEW |