| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 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/frame/csp/ContentSecurityPolicy.h" |
| 35 #include "core/loader/BaseFetchContext.h" | 36 #include "core/loader/BaseFetchContext.h" |
| 36 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 37 #include "platform/loader/fetch/FetchParameters.h" | 38 #include "platform/loader/fetch/FetchParameters.h" |
| 38 #include "platform/loader/fetch/ResourceFetcher.h" | 39 #include "platform/loader/fetch/ResourceFetcher.h" |
| 39 #include "platform/loader/fetch/ResourceRequest.h" | 40 #include "platform/loader/fetch/ResourceRequest.h" |
| 41 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 40 #include "platform/wtf/Forward.h" | 42 #include "platform/wtf/Forward.h" |
| 41 | 43 |
| 42 namespace blink { | 44 namespace blink { |
| 43 | 45 |
| 44 class ClientHintsPreferences; | 46 class ClientHintsPreferences; |
| 45 class ContentSettingsClient; | 47 class ContentSettingsClient; |
| 46 class Document; | 48 class Document; |
| 47 class DocumentLoader; | 49 class DocumentLoader; |
| 48 class LocalFrame; | 50 class LocalFrame; |
| 49 class LocalFrameClient; | 51 class LocalFrameClient; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 118 |
| 117 void AddResourceTiming(const ResourceTimingInfo&) override; | 119 void AddResourceTiming(const ResourceTimingInfo&) override; |
| 118 bool AllowImage(bool images_enabled, const KURL&) const override; | 120 bool AllowImage(bool images_enabled, const KURL&) const override; |
| 119 ResourceRequestBlockedReason CanRequest( | 121 ResourceRequestBlockedReason CanRequest( |
| 120 Resource::Type, | 122 Resource::Type, |
| 121 const ResourceRequest&, | 123 const ResourceRequest&, |
| 122 const KURL&, | 124 const KURL&, |
| 123 const ResourceLoaderOptions&, | 125 const ResourceLoaderOptions&, |
| 124 SecurityViolationReportingPolicy, | 126 SecurityViolationReportingPolicy, |
| 125 FetchParameters::OriginRestriction) const override; | 127 FetchParameters::OriginRestriction) const override; |
| 128 ResourceRequestBlockedReason CanFollowRedirect( |
| 129 Resource::Type, |
| 130 const ResourceRequest&, |
| 131 const KURL&, |
| 132 const ResourceLoaderOptions&, |
| 133 SecurityViolationReportingPolicy, |
| 134 FetchParameters::OriginRestriction) const override; |
| 126 ResourceRequestBlockedReason AllowResponse( | 135 ResourceRequestBlockedReason AllowResponse( |
| 127 Resource::Type, | 136 Resource::Type, |
| 128 const ResourceRequest&, | 137 const ResourceRequest&, |
| 129 const KURL&, | 138 const KURL&, |
| 130 const ResourceLoaderOptions&) const override; | 139 const ResourceLoaderOptions&) const override; |
| 131 | 140 |
| 132 bool IsControlledByServiceWorker() const override; | 141 bool IsControlledByServiceWorker() const override; |
| 133 int64_t ServiceWorkerID() const override; | 142 int64_t ServiceWorkerID() const override; |
| 134 | 143 |
| 135 bool IsMainFrame() const override; | 144 bool IsMainFrame() const override; |
| 136 bool DefersLoading() const override; | 145 bool DefersLoading() const override; |
| 137 bool IsLoadComplete() const override; | 146 bool IsLoadComplete() const override; |
| 138 bool PageDismissalEventBeingDispatched() const override; | 147 bool PageDismissalEventBeingDispatched() const override; |
| 139 bool UpdateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; | 148 bool UpdateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; |
| 140 void SendImagePing(const KURL&) override; | 149 void SendImagePing(const KURL&) override; |
| 141 void AddConsoleMessage(const String&, | 150 void AddConsoleMessage(const String&, |
| 142 LogMessageType = kLogErrorMessage) const override; | 151 LogMessageType = kLogErrorMessage) const override; |
| 143 | 152 |
| 144 void PopulateResourceRequest(Resource::Type, | 153 void PopulateResourceRequest(const KURL&, |
| 154 Resource::Type, |
| 145 const ClientHintsPreferences&, | 155 const ClientHintsPreferences&, |
| 146 const FetchParameters::ResourceWidth&, | 156 const FetchParameters::ResourceWidth&, |
| 157 const ResourceLoaderOptions&, |
| 158 SecurityViolationReportingPolicy, |
| 147 ResourceRequest&) override; | 159 ResourceRequest&) override; |
| 148 void SetFirstPartyCookieAndRequestorOrigin(ResourceRequest&) override; | 160 void SetFirstPartyCookieAndRequestorOrigin(ResourceRequest&) override; |
| 149 | 161 |
| 150 // Exposed for testing. | 162 // Exposed for testing. |
| 151 void ModifyRequestForCSP(ResourceRequest&); | 163 void ModifyRequestForCSP(ResourceRequest&); |
| 152 void AddClientHintsIfNecessary(const ClientHintsPreferences&, | 164 void AddClientHintsIfNecessary(const ClientHintsPreferences&, |
| 153 const FetchParameters::ResourceWidth&, | 165 const FetchParameters::ResourceWidth&, |
| 154 ResourceRequest&); | 166 ResourceRequest&); |
| 155 | 167 |
| 156 MHTMLArchive* Archive() const override; | 168 MHTMLArchive* Archive() const override; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 181 | 193 |
| 182 ResourceRequestBlockedReason CanRequestInternal( | 194 ResourceRequestBlockedReason CanRequestInternal( |
| 183 Resource::Type, | 195 Resource::Type, |
| 184 const ResourceRequest&, | 196 const ResourceRequest&, |
| 185 const KURL&, | 197 const KURL&, |
| 186 const ResourceLoaderOptions&, | 198 const ResourceLoaderOptions&, |
| 187 SecurityViolationReportingPolicy, | 199 SecurityViolationReportingPolicy, |
| 188 FetchParameters::OriginRestriction, | 200 FetchParameters::OriginRestriction, |
| 189 ResourceRequest::RedirectStatus) const; | 201 ResourceRequest::RedirectStatus) const; |
| 190 | 202 |
| 203 ResourceRequestBlockedReason CheckCSPForRequest( |
| 204 const ResourceRequest&, |
| 205 const KURL&, |
| 206 const ResourceLoaderOptions&, |
| 207 SecurityViolationReportingPolicy, |
| 208 ResourceRequest::RedirectStatus, |
| 209 ContentSecurityPolicy::CheckHeaderType) const; |
| 210 |
| 191 Member<DocumentLoader> document_loader_; | 211 Member<DocumentLoader> document_loader_; |
| 192 }; | 212 }; |
| 193 | 213 |
| 194 } // namespace blink | 214 } // namespace blink |
| 195 | 215 |
| 196 #endif | 216 #endif |
| OLD | NEW |