| 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 FetchContext_h | 31 #ifndef FetchContext_h |
| 32 #define FetchContext_h | 32 #define FetchContext_h |
| 33 | 33 |
| 34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 36 #include "platform/loader/fetch/FetchInitiatorInfo.h" | 36 #include "platform/loader/fetch/FetchInitiatorInfo.h" |
| 37 #include "platform/loader/fetch/FetchParameters.h" | 37 #include "platform/loader/fetch/FetchParameters.h" |
| 38 #include "platform/loader/fetch/Resource.h" | 38 #include "platform/loader/fetch/Resource.h" |
| 39 #include "platform/loader/fetch/ResourceLoadPriority.h" | 39 #include "platform/loader/fetch/ResourceLoadPriority.h" |
| 40 #include "platform/loader/fetch/ResourceRequest.h" | 40 #include "platform/loader/fetch/ResourceRequest.h" |
| 41 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 41 #include "platform/weborigin/SecurityViolationReportingPolicy.h" | 42 #include "platform/weborigin/SecurityViolationReportingPolicy.h" |
| 42 #include "platform/wtf/Forward.h" | 43 #include "platform/wtf/Forward.h" |
| 43 #include "platform/wtf/Noncopyable.h" | 44 #include "platform/wtf/Noncopyable.h" |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| 47 class ClientHintsPreferences; | 48 class ClientHintsPreferences; |
| 48 class KURL; | 49 class KURL; |
| 49 class MHTMLArchive; | 50 class MHTMLArchive; |
| 50 class PlatformProbeSink; | 51 class PlatformProbeSink; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 virtual bool AllowImage(bool, const KURL&) const { return false; } | 148 virtual bool AllowImage(bool, const KURL&) const { return false; } |
| 148 virtual ResourceRequestBlockedReason CanRequest( | 149 virtual ResourceRequestBlockedReason CanRequest( |
| 149 Resource::Type, | 150 Resource::Type, |
| 150 const ResourceRequest&, | 151 const ResourceRequest&, |
| 151 const KURL&, | 152 const KURL&, |
| 152 const ResourceLoaderOptions&, | 153 const ResourceLoaderOptions&, |
| 153 SecurityViolationReportingPolicy, | 154 SecurityViolationReportingPolicy, |
| 154 FetchParameters::OriginRestriction) const { | 155 FetchParameters::OriginRestriction) const { |
| 155 return ResourceRequestBlockedReason::kOther; | 156 return ResourceRequestBlockedReason::kOther; |
| 156 } | 157 } |
| 158 virtual ResourceRequestBlockedReason CanFollowRedirect( |
| 159 Resource::Type, |
| 160 const ResourceRequest&, |
| 161 const KURL&, |
| 162 const ResourceLoaderOptions&, |
| 163 SecurityViolationReportingPolicy, |
| 164 FetchParameters::OriginRestriction) const { |
| 165 return ResourceRequestBlockedReason::kOther; |
| 166 } |
| 157 virtual ResourceRequestBlockedReason AllowResponse( | 167 virtual ResourceRequestBlockedReason AllowResponse( |
| 158 Resource::Type, | 168 Resource::Type, |
| 159 const ResourceRequest&, | 169 const ResourceRequest&, |
| 160 const KURL&, | 170 const KURL&, |
| 161 const ResourceLoaderOptions&) const { | 171 const ResourceLoaderOptions&) const { |
| 162 return ResourceRequestBlockedReason::kOther; | 172 return ResourceRequestBlockedReason::kOther; |
| 163 } | 173 } |
| 164 | 174 |
| 165 virtual bool IsControlledByServiceWorker() const { return false; } | 175 virtual bool IsControlledByServiceWorker() const { return false; } |
| 166 virtual int64_t ServiceWorkerID() const { return -1; } | 176 virtual int64_t ServiceWorkerID() const { return -1; } |
| 167 | 177 |
| 168 virtual bool IsMainFrame() const { return true; } | 178 virtual bool IsMainFrame() const { return true; } |
| 169 virtual bool DefersLoading() const { return false; } | 179 virtual bool DefersLoading() const { return false; } |
| 170 virtual bool IsLoadComplete() const { return false; } | 180 virtual bool IsLoadComplete() const { return false; } |
| 171 virtual bool PageDismissalEventBeingDispatched() const { return false; } | 181 virtual bool PageDismissalEventBeingDispatched() const { return false; } |
| 172 virtual bool UpdateTimingInfoForIFrameNavigation(ResourceTimingInfo*) { | 182 virtual bool UpdateTimingInfoForIFrameNavigation(ResourceTimingInfo*) { |
| 173 return false; | 183 return false; |
| 174 } | 184 } |
| 175 virtual void SendImagePing(const KURL&); | 185 virtual void SendImagePing(const KURL&); |
| 176 virtual void AddConsoleMessage(const String&, | 186 virtual void AddConsoleMessage(const String&, |
| 177 LogMessageType = kLogErrorMessage) const; | 187 LogMessageType = kLogErrorMessage) const; |
| 178 virtual SecurityOrigin* GetSecurityOrigin() const { return nullptr; } | 188 virtual SecurityOrigin* GetSecurityOrigin() const { return nullptr; } |
| 179 | 189 |
| 180 // Populates the ResourceRequest using the given values and information | 190 // Populates the ResourceRequest using the given values and information |
| 181 // stored in the FetchContext implementation. Used by ResourceFetcher to | 191 // stored in the FetchContext implementation. Used by ResourceFetcher to |
| 182 // prepare a ResourceRequest instance at the start of resource loading. | 192 // prepare a ResourceRequest instance at the start of resource loading. |
| 183 virtual void PopulateResourceRequest(Resource::Type, | 193 virtual void PopulateResourceRequest(const KURL&, |
| 194 Resource::Type, |
| 184 const ClientHintsPreferences&, | 195 const ClientHintsPreferences&, |
| 185 const FetchParameters::ResourceWidth&, | 196 const FetchParameters::ResourceWidth&, |
| 197 const ResourceLoaderOptions&, |
| 198 SecurityViolationReportingPolicy, |
| 186 ResourceRequest&); | 199 ResourceRequest&); |
| 187 // Sets the first party for cookies and requestor origin using information | 200 // Sets the first party for cookies and requestor origin using information |
| 188 // stored in the FetchContext implementation. | 201 // stored in the FetchContext implementation. |
| 189 virtual void SetFirstPartyCookieAndRequestorOrigin(ResourceRequest&); | 202 virtual void SetFirstPartyCookieAndRequestorOrigin(ResourceRequest&); |
| 190 | 203 |
| 191 virtual MHTMLArchive* Archive() const { return nullptr; } | 204 virtual MHTMLArchive* Archive() const { return nullptr; } |
| 192 | 205 |
| 193 virtual ResourceLoadPriority ModifyPriorityForExperiments( | 206 virtual ResourceLoadPriority ModifyPriorityForExperiments( |
| 194 ResourceLoadPriority priority) { | 207 ResourceLoadPriority priority) { |
| 195 return priority; | 208 return priority; |
| 196 } | 209 } |
| 197 | 210 |
| 198 virtual RefPtr<WebTaskRunner> LoadingTaskRunner() const { return nullptr; } | 211 virtual RefPtr<WebTaskRunner> LoadingTaskRunner() const { return nullptr; } |
| 199 | 212 |
| 200 PlatformProbeSink* GetPlatformProbeSink() const { | 213 PlatformProbeSink* GetPlatformProbeSink() const { |
| 201 return platform_probe_sink_; | 214 return platform_probe_sink_; |
| 202 } | 215 } |
| 203 | 216 |
| 204 protected: | 217 protected: |
| 205 FetchContext(); | 218 FetchContext(); |
| 206 | 219 |
| 207 private: | 220 private: |
| 208 Member<PlatformProbeSink> platform_probe_sink_; | 221 Member<PlatformProbeSink> platform_probe_sink_; |
| 209 }; | 222 }; |
| 210 | 223 |
| 211 } // namespace blink | 224 } // namespace blink |
| 212 | 225 |
| 213 #endif | 226 #endif |
| OLD | NEW |