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 20 matching lines...) Expand all Loading... |
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/frame/csp/ContentSecurityPolicy.h" | 35 #include "core/frame/csp/ContentSecurityPolicy.h" |
36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
37 #include "platform/loader/fetch/FetchContext.h" | 37 #include "platform/loader/fetch/FetchContext.h" |
38 #include "platform/loader/fetch/FetchParameters.h" | 38 #include "platform/loader/fetch/FetchParameters.h" |
39 #include "platform/loader/fetch/ResourceFetcher.h" | 39 #include "platform/loader/fetch/ResourceFetcher.h" |
40 #include "platform/loader/fetch/ResourceRequest.h" | 40 #include "platform/loader/fetch/ResourceRequest.h" |
| 41 #include "platform/network/ContentSecurityPolicyParsers.h" |
41 #include "platform/wtf/Forward.h" | 42 #include "platform/wtf/Forward.h" |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
45 class ClientHintsPreferences; | 46 class ClientHintsPreferences; |
46 class ContentSettingsClient; | 47 class ContentSettingsClient; |
47 class Document; | 48 class Document; |
48 class DocumentLoader; | 49 class DocumentLoader; |
49 class LocalFrame; | 50 class LocalFrame; |
50 class LocalFrameClient; | 51 class LocalFrameClient; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 123 |
123 void AddResourceTiming(const ResourceTimingInfo&) override; | 124 void AddResourceTiming(const ResourceTimingInfo&) override; |
124 bool AllowImage(bool images_enabled, const KURL&) const override; | 125 bool AllowImage(bool images_enabled, const KURL&) const override; |
125 ResourceRequestBlockedReason CanRequest( | 126 ResourceRequestBlockedReason CanRequest( |
126 Resource::Type, | 127 Resource::Type, |
127 const ResourceRequest&, | 128 const ResourceRequest&, |
128 const KURL&, | 129 const KURL&, |
129 const ResourceLoaderOptions&, | 130 const ResourceLoaderOptions&, |
130 SecurityViolationReportingPolicy, | 131 SecurityViolationReportingPolicy, |
131 FetchParameters::OriginRestriction) const override; | 132 FetchParameters::OriginRestriction) const override; |
| 133 ResourceRequestBlockedReason CanFollowRedirect( |
| 134 Resource::Type, |
| 135 const ResourceRequest&, |
| 136 const KURL&, |
| 137 const ResourceLoaderOptions&, |
| 138 SecurityViolationReportingPolicy, |
| 139 FetchParameters::OriginRestriction) const override; |
132 ResourceRequestBlockedReason AllowResponse( | 140 ResourceRequestBlockedReason AllowResponse( |
133 Resource::Type, | 141 Resource::Type, |
134 const ResourceRequest&, | 142 const ResourceRequest&, |
135 const KURL&, | 143 const KURL&, |
136 const ResourceLoaderOptions&) const override; | 144 const ResourceLoaderOptions&) const override; |
137 | 145 |
138 bool IsControlledByServiceWorker() const override; | 146 bool IsControlledByServiceWorker() const override; |
139 int64_t ServiceWorkerID() const override; | 147 int64_t ServiceWorkerID() const override; |
140 | 148 |
141 bool IsMainFrame() const override; | 149 bool IsMainFrame() const override; |
142 bool DefersLoading() const override; | 150 bool DefersLoading() const override; |
143 bool IsLoadComplete() const override; | 151 bool IsLoadComplete() const override; |
144 bool PageDismissalEventBeingDispatched() const override; | 152 bool PageDismissalEventBeingDispatched() const override; |
145 bool UpdateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; | 153 bool UpdateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; |
146 void SendImagePing(const KURL&) override; | 154 void SendImagePing(const KURL&) override; |
147 void AddConsoleMessage(const String&, | 155 void AddConsoleMessage(const String&, |
148 LogMessageType = kLogErrorMessage) const override; | 156 LogMessageType = kLogErrorMessage) const override; |
149 SecurityOrigin* GetSecurityOrigin() const override; | 157 SecurityOrigin* GetSecurityOrigin() const override; |
150 | 158 |
151 void PopulateResourceRequest(Resource::Type, | 159 void PopulateResourceRequest(const KURL&, |
| 160 Resource::Type, |
152 const ClientHintsPreferences&, | 161 const ClientHintsPreferences&, |
153 const FetchParameters::ResourceWidth&, | 162 const FetchParameters::ResourceWidth&, |
| 163 const ResourceLoaderOptions&, |
| 164 SecurityViolationReportingPolicy, |
154 ResourceRequest&) override; | 165 ResourceRequest&) override; |
155 void SetFirstPartyCookieAndRequestorOrigin(ResourceRequest&) override; | 166 void SetFirstPartyCookieAndRequestorOrigin(ResourceRequest&) override; |
156 | 167 |
157 // Exposed for testing. | 168 // Exposed for testing. |
158 void ModifyRequestForCSP(ResourceRequest&); | 169 void ModifyRequestForCSP(ResourceRequest&); |
159 void AddClientHintsIfNecessary(const ClientHintsPreferences&, | 170 void AddClientHintsIfNecessary(const ClientHintsPreferences&, |
160 const FetchParameters::ResourceWidth&, | 171 const FetchParameters::ResourceWidth&, |
161 ResourceRequest&); | 172 ResourceRequest&); |
162 | 173 |
163 MHTMLArchive* Archive() const override; | 174 MHTMLArchive* Archive() const override; |
(...skipping 26 matching lines...) Expand all Loading... |
190 Resource::Type, | 201 Resource::Type, |
191 const ResourceRequest&, | 202 const ResourceRequest&, |
192 const KURL&, | 203 const KURL&, |
193 const ResourceLoaderOptions&, | 204 const ResourceLoaderOptions&, |
194 SecurityViolationReportingPolicy, | 205 SecurityViolationReportingPolicy, |
195 FetchParameters::OriginRestriction, | 206 FetchParameters::OriginRestriction, |
196 ResourceRequest::RedirectStatus) const; | 207 ResourceRequest::RedirectStatus) const; |
197 | 208 |
198 void AddCSPHeaderIfNecessary(Resource::Type, ResourceRequest&); | 209 void AddCSPHeaderIfNecessary(Resource::Type, ResourceRequest&); |
199 | 210 |
| 211 ResourceRequestBlockedReason CheckCSPForRequest( |
| 212 const ResourceRequest&, |
| 213 const KURL&, |
| 214 const ResourceLoaderOptions&, |
| 215 SecurityViolationReportingPolicy, |
| 216 ResourceRequest::RedirectStatus, |
| 217 ContentSecurityPolicy::CheckHeaderType) const; |
| 218 |
200 // FIXME: Oilpan: Ideally this should just be a traced Member but that will | 219 // FIXME: Oilpan: Ideally this should just be a traced Member but that will |
201 // currently leak because ComputedStyle and its data are not on the heap. | 220 // currently leak because ComputedStyle and its data are not on the heap. |
202 // See crbug.com/383860 for details. | 221 // See crbug.com/383860 for details. |
203 WeakMember<Document> document_; | 222 WeakMember<Document> document_; |
204 Member<DocumentLoader> document_loader_; | 223 Member<DocumentLoader> document_loader_; |
205 }; | 224 }; |
206 | 225 |
207 } // namespace blink | 226 } // namespace blink |
208 | 227 |
209 #endif | 228 #endif |
OLD | NEW |