| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
| 4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef ResourceRequest_h | 28 #ifndef ResourceRequest_h |
| 29 #define ResourceRequest_h | 29 #define ResourceRequest_h |
| 30 | 30 |
| 31 #include "platform/HTTPNames.h" | 31 #include "platform/HTTPNames.h" |
| 32 #include "platform/network/EncodedFormData.h" | 32 #include "platform/network/EncodedFormData.h" |
| 33 #include "platform/network/HTTPHeaderMap.h" | 33 #include "platform/network/HTTPHeaderMap.h" |
| 34 #include "platform/network/HTTPParsers.h" | 34 #include "platform/network/HTTPParsers.h" |
| 35 #include "platform/network/ResourceLoadPriority.h" | 35 #include "platform/network/ResourceLoadPriority.h" |
| 36 #include "platform/network/ResourceResponse.h" |
| 36 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 37 #include "platform/weborigin/Referrer.h" | 38 #include "platform/weborigin/Referrer.h" |
| 38 #include "platform/weborigin/SecurityOrigin.h" | 39 #include "platform/weborigin/SecurityOrigin.h" |
| 39 #include "public/platform/WebAddressSpace.h" | 40 #include "public/platform/WebAddressSpace.h" |
| 40 #include "public/platform/WebURLRequest.h" | 41 #include "public/platform/WebURLRequest.h" |
| 42 #include "public/platform/WebURLResponse.h" |
| 41 #include "wtf/RefCounted.h" | 43 #include "wtf/RefCounted.h" |
| 42 #include <memory> | 44 #include <memory> |
| 43 | 45 |
| 44 namespace blink { | 46 namespace blink { |
| 45 | 47 |
| 46 enum class WebCachePolicy; | 48 enum class WebCachePolicy; |
| 47 | 49 |
| 48 enum ResourceRequestBlockedReason { | 50 enum ResourceRequestBlockedReason { |
| 49 ResourceRequestBlockedReasonCSP, | 51 ResourceRequestBlockedReasonCSP, |
| 50 ResourceRequestBlockedReasonMixedContent, | 52 ResourceRequestBlockedReasonMixedContent, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 84 |
| 83 // Gets a copy of the data suitable for passing to another thread. | 85 // Gets a copy of the data suitable for passing to another thread. |
| 84 std::unique_ptr<CrossThreadResourceRequestData> copyData() const; | 86 std::unique_ptr<CrossThreadResourceRequestData> copyData() const; |
| 85 | 87 |
| 86 bool isNull() const; | 88 bool isNull() const; |
| 87 bool isEmpty() const; | 89 bool isEmpty() const; |
| 88 | 90 |
| 89 const KURL& url() const; | 91 const KURL& url() const; |
| 90 void setURL(const KURL& url); | 92 void setURL(const KURL& url); |
| 91 | 93 |
| 94 const KURL& initialUrl() const; |
| 95 |
| 92 void removeCredentials(); | 96 void removeCredentials(); |
| 93 | 97 |
| 94 WebCachePolicy getCachePolicy() const; | 98 WebCachePolicy getCachePolicy() const; |
| 95 void setCachePolicy(WebCachePolicy); | 99 void setCachePolicy(WebCachePolicy); |
| 96 | 100 |
| 97 double timeoutInterval() const; // May return 0 when using platform default. | 101 double timeoutInterval() const; // May return 0 when using platform default. |
| 98 void setTimeoutInterval(double timeoutInterval); | 102 void setTimeoutInterval(double timeoutInterval); |
| 99 | 103 |
| 100 const KURL& firstPartyForCookies() const; | 104 const KURL& firstPartyForCookies() const; |
| 101 void setFirstPartyForCookies(const KURL& firstPartyForCookies); | 105 void setFirstPartyForCookies(const KURL& firstPartyForCookies); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // https://mikewest.github.io/cors-rfc1918/#external-request | 234 // https://mikewest.github.io/cors-rfc1918/#external-request |
| 231 bool isExternalRequest() const { return m_isExternalRequest; } | 235 bool isExternalRequest() const { return m_isExternalRequest; } |
| 232 void setExternalRequestStateFromRequestorAddressSpace(WebAddressSpace); | 236 void setExternalRequestStateFromRequestorAddressSpace(WebAddressSpace); |
| 233 | 237 |
| 234 InputToLoadPerfMetricReportPolicy inputPerfMetricReportPolicy() const { retu
rn m_inputPerfMetricReportPolicy; } | 238 InputToLoadPerfMetricReportPolicy inputPerfMetricReportPolicy() const { retu
rn m_inputPerfMetricReportPolicy; } |
| 235 void setInputPerfMetricReportPolicy(InputToLoadPerfMetricReportPolicy inputP
erfMetricReportPolicy) { m_inputPerfMetricReportPolicy = inputPerfMetricReportPo
licy; } | 239 void setInputPerfMetricReportPolicy(InputToLoadPerfMetricReportPolicy inputP
erfMetricReportPolicy) { m_inputPerfMetricReportPolicy = inputPerfMetricReportPo
licy; } |
| 236 | 240 |
| 237 void setRedirectStatus(RedirectStatus status) { m_redirectStatus = status; } | 241 void setRedirectStatus(RedirectStatus status) { m_redirectStatus = status; } |
| 238 RedirectStatus redirectStatus() const { return m_redirectStatus; } | 242 RedirectStatus redirectStatus() const { return m_redirectStatus; } |
| 239 | 243 |
| 244 // Inform the request of previous navigations in the redirect chain that |
| 245 // happened outside of blink. |
| 246 void appendPreviousResponse(const WebURLResponse&); |
| 247 const std::vector<WebURLResponse>& previousResponses() const { return m_resp
onses; } |
| 248 |
| 249 void setPreviousNavigationStart(double); |
| 250 double previousNavigationStart() const { return m_navigationStart; } |
| 251 |
| 240 private: | 252 private: |
| 241 void initialize(const KURL&); | 253 void initialize(const KURL&); |
| 242 | 254 |
| 243 const CacheControlHeader& cacheControlHeader() const; | 255 const CacheControlHeader& cacheControlHeader() const; |
| 244 | 256 |
| 245 KURL m_url; | 257 KURL m_url; |
| 246 WebCachePolicy m_cachePolicy; | 258 WebCachePolicy m_cachePolicy; |
| 247 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. | 259 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. |
| 248 KURL m_firstPartyForCookies; | 260 KURL m_firstPartyForCookies; |
| 249 RefPtr<SecurityOrigin> m_requestorOrigin; | 261 RefPtr<SecurityOrigin> m_requestorOrigin; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 276 bool m_checkForBrowserSideNavigation; | 288 bool m_checkForBrowserSideNavigation; |
| 277 double m_uiStartTime; | 289 double m_uiStartTime; |
| 278 bool m_isExternalRequest; | 290 bool m_isExternalRequest; |
| 279 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; | 291 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; |
| 280 | 292 |
| 281 mutable CacheControlHeader m_cacheControlHeaderCache; | 293 mutable CacheControlHeader m_cacheControlHeaderCache; |
| 282 | 294 |
| 283 static double s_defaultTimeoutInterval; | 295 static double s_defaultTimeoutInterval; |
| 284 | 296 |
| 285 RedirectStatus m_redirectStatus; | 297 RedirectStatus m_redirectStatus; |
| 298 |
| 299 std::vector<WebURLResponse> m_responses; |
| 300 double m_navigationStart = 0; |
| 286 }; | 301 }; |
| 287 | 302 |
| 288 struct CrossThreadResourceRequestData { | 303 struct CrossThreadResourceRequestData { |
| 289 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); USING_FAST_MALLOC(Cros
sThreadResourceRequestData); | 304 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); USING_FAST_MALLOC(Cros
sThreadResourceRequestData); |
| 290 public: | 305 public: |
| 291 CrossThreadResourceRequestData() { } | 306 CrossThreadResourceRequestData() { } |
| 292 KURL m_url; | 307 KURL m_url; |
| 293 | 308 |
| 294 WebCachePolicy m_cachePolicy; | 309 WebCachePolicy m_cachePolicy; |
| 295 double m_timeoutInterval; | 310 double m_timeoutInterval; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 318 WebURLRequest::FetchCredentialsMode m_fetchCredentialsMode; | 333 WebURLRequest::FetchCredentialsMode m_fetchCredentialsMode; |
| 319 WebURLRequest::FetchRedirectMode m_fetchRedirectMode; | 334 WebURLRequest::FetchRedirectMode m_fetchRedirectMode; |
| 320 WebURLRequest::LoFiState m_loFiState; | 335 WebURLRequest::LoFiState m_loFiState; |
| 321 ReferrerPolicy m_referrerPolicy; | 336 ReferrerPolicy m_referrerPolicy; |
| 322 bool m_didSetHTTPReferrer; | 337 bool m_didSetHTTPReferrer; |
| 323 bool m_checkForBrowserSideNavigation; | 338 bool m_checkForBrowserSideNavigation; |
| 324 double m_uiStartTime; | 339 double m_uiStartTime; |
| 325 bool m_isExternalRequest; | 340 bool m_isExternalRequest; |
| 326 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; | 341 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; |
| 327 ResourceRequest::RedirectStatus m_redirectStatus; | 342 ResourceRequest::RedirectStatus m_redirectStatus; |
| 343 std::vector<std::unique_ptr<CrossThreadResourceResponseData>> m_responses; |
| 344 double m_navigationStart = 0; |
| 328 }; | 345 }; |
| 329 | 346 |
| 330 } // namespace blink | 347 } // namespace blink |
| 331 | 348 |
| 332 #endif // ResourceRequest_h | 349 #endif // ResourceRequest_h |
| OLD | NEW |