| 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 24 matching lines...) Expand all Loading... |
| 35 #include "platform/network/ResourceLoadPriority.h" | 35 #include "platform/network/ResourceLoadPriority.h" |
| 36 #include "platform/weborigin/KURL.h" | 36 #include "platform/weborigin/KURL.h" |
| 37 #include "platform/weborigin/Referrer.h" | 37 #include "platform/weborigin/Referrer.h" |
| 38 #include "platform/weborigin/SecurityOrigin.h" | 38 #include "platform/weborigin/SecurityOrigin.h" |
| 39 #include "public/platform/WebAddressSpace.h" | 39 #include "public/platform/WebAddressSpace.h" |
| 40 #include "public/platform/WebURLRequest.h" | 40 #include "public/platform/WebURLRequest.h" |
| 41 #include "wtf/OwnPtr.h" | 41 #include "wtf/OwnPtr.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 // Should be same with WebURLRequest::CachePolicy. | 45 enum class WebCachePolicy; |
| 46 // TODO(crbug.com/599364): Merge this with WebURLRequest::CachePolicy | |
| 47 enum ResourceRequestCachePolicy { | |
| 48 UseProtocolCachePolicy, // normal load | |
| 49 ValidatingCacheData, // reload | |
| 50 BypassingCache, // end-to-end reload | |
| 51 ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale da
ta | |
| 52 ReturnCacheDataDontLoad, // results of a post - allow stale data and only us
e cache | |
| 53 }; | |
| 54 | 46 |
| 55 enum ResourceRequestBlockedReason { | 47 enum ResourceRequestBlockedReason { |
| 56 ResourceRequestBlockedReasonCSP, | 48 ResourceRequestBlockedReasonCSP, |
| 57 ResourceRequestBlockedReasonMixedContent, | 49 ResourceRequestBlockedReasonMixedContent, |
| 58 ResourceRequestBlockedReasonOrigin, | 50 ResourceRequestBlockedReasonOrigin, |
| 59 ResourceRequestBlockedReasonInspector, | 51 ResourceRequestBlockedReasonInspector, |
| 60 ResourceRequestBlockedReasonOther, | 52 ResourceRequestBlockedReasonOther, |
| 61 ResourceRequestBlockedReasonNone | 53 ResourceRequestBlockedReasonNone |
| 62 }; | 54 }; |
| 63 | 55 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 PassOwnPtr<CrossThreadResourceRequestData> copyData() const; | 90 PassOwnPtr<CrossThreadResourceRequestData> copyData() const; |
| 99 | 91 |
| 100 bool isNull() const; | 92 bool isNull() const; |
| 101 bool isEmpty() const; | 93 bool isEmpty() const; |
| 102 | 94 |
| 103 const KURL& url() const; | 95 const KURL& url() const; |
| 104 void setURL(const KURL& url); | 96 void setURL(const KURL& url); |
| 105 | 97 |
| 106 void removeCredentials(); | 98 void removeCredentials(); |
| 107 | 99 |
| 108 ResourceRequestCachePolicy getCachePolicy() const; | 100 WebCachePolicy getCachePolicy() const; |
| 109 void setCachePolicy(ResourceRequestCachePolicy cachePolicy); | 101 void setCachePolicy(WebCachePolicy); |
| 110 | 102 |
| 111 double timeoutInterval() const; // May return 0 when using platform default. | 103 double timeoutInterval() const; // May return 0 when using platform default. |
| 112 void setTimeoutInterval(double timeoutInterval); | 104 void setTimeoutInterval(double timeoutInterval); |
| 113 | 105 |
| 114 const KURL& firstPartyForCookies() const; | 106 const KURL& firstPartyForCookies() const; |
| 115 void setFirstPartyForCookies(const KURL& firstPartyForCookies); | 107 void setFirstPartyForCookies(const KURL& firstPartyForCookies); |
| 116 | 108 |
| 117 PassRefPtr<SecurityOrigin> requestorOrigin() const; | 109 PassRefPtr<SecurityOrigin> requestorOrigin() const; |
| 118 void setRequestorOrigin(PassRefPtr<SecurityOrigin>); | 110 void setRequestorOrigin(PassRefPtr<SecurityOrigin>); |
| 119 | 111 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 242 |
| 251 void setFollowedRedirect(bool followed) { m_followedRedirect = followed; } | 243 void setFollowedRedirect(bool followed) { m_followedRedirect = followed; } |
| 252 bool followedRedirect() const { return m_followedRedirect; } | 244 bool followedRedirect() const { return m_followedRedirect; } |
| 253 | 245 |
| 254 private: | 246 private: |
| 255 void initialize(const KURL&); | 247 void initialize(const KURL&); |
| 256 | 248 |
| 257 const CacheControlHeader& cacheControlHeader() const; | 249 const CacheControlHeader& cacheControlHeader() const; |
| 258 | 250 |
| 259 KURL m_url; | 251 KURL m_url; |
| 260 ResourceRequestCachePolicy m_cachePolicy; | 252 WebCachePolicy m_cachePolicy; |
| 261 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. | 253 double m_timeoutInterval; // 0 is a magic value for platform default on plat
forms that have one. |
| 262 KURL m_firstPartyForCookies; | 254 KURL m_firstPartyForCookies; |
| 263 RefPtr<SecurityOrigin> m_requestorOrigin; | 255 RefPtr<SecurityOrigin> m_requestorOrigin; |
| 264 AtomicString m_httpMethod; | 256 AtomicString m_httpMethod; |
| 265 HTTPHeaderMap m_httpHeaderFields; | 257 HTTPHeaderMap m_httpHeaderFields; |
| 266 RefPtr<EncodedFormData> m_httpBody; | 258 RefPtr<EncodedFormData> m_httpBody; |
| 267 bool m_allowStoredCredentials : 1; | 259 bool m_allowStoredCredentials : 1; |
| 268 bool m_reportUploadProgress : 1; | 260 bool m_reportUploadProgress : 1; |
| 269 bool m_reportRawHeaders : 1; | 261 bool m_reportRawHeaders : 1; |
| 270 bool m_hasUserGesture : 1; | 262 bool m_hasUserGesture : 1; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 300 | 292 |
| 301 inline bool operator==(const ResourceRequest& a, const ResourceRequest& b) { ret
urn ResourceRequest::compare(a, b); } | 293 inline bool operator==(const ResourceRequest& a, const ResourceRequest& b) { ret
urn ResourceRequest::compare(a, b); } |
| 302 inline bool operator!=(ResourceRequest& a, const ResourceRequest& b) { return !(
a == b); } | 294 inline bool operator!=(ResourceRequest& a, const ResourceRequest& b) { return !(
a == b); } |
| 303 | 295 |
| 304 struct CrossThreadResourceRequestData { | 296 struct CrossThreadResourceRequestData { |
| 305 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); USING_FAST_MALLOC(Cros
sThreadResourceRequestData); | 297 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); USING_FAST_MALLOC(Cros
sThreadResourceRequestData); |
| 306 public: | 298 public: |
| 307 CrossThreadResourceRequestData() { } | 299 CrossThreadResourceRequestData() { } |
| 308 KURL m_url; | 300 KURL m_url; |
| 309 | 301 |
| 310 ResourceRequestCachePolicy m_cachePolicy; | 302 WebCachePolicy m_cachePolicy; |
| 311 double m_timeoutInterval; | 303 double m_timeoutInterval; |
| 312 KURL m_firstPartyForCookies; | 304 KURL m_firstPartyForCookies; |
| 313 RefPtr<SecurityOrigin> m_requestorOrigin; | 305 RefPtr<SecurityOrigin> m_requestorOrigin; |
| 314 | 306 |
| 315 String m_httpMethod; | 307 String m_httpMethod; |
| 316 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; | 308 OwnPtr<CrossThreadHTTPHeaderMapData> m_httpHeaders; |
| 317 RefPtr<EncodedFormData> m_httpBody; | 309 RefPtr<EncodedFormData> m_httpBody; |
| 318 bool m_allowStoredCredentials; | 310 bool m_allowStoredCredentials; |
| 319 bool m_reportUploadProgress; | 311 bool m_reportUploadProgress; |
| 320 bool m_hasUserGesture; | 312 bool m_hasUserGesture; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 338 bool m_checkForBrowserSideNavigation; | 330 bool m_checkForBrowserSideNavigation; |
| 339 double m_uiStartTime; | 331 double m_uiStartTime; |
| 340 bool m_isExternalRequest; | 332 bool m_isExternalRequest; |
| 341 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; | 333 InputToLoadPerfMetricReportPolicy m_inputPerfMetricReportPolicy; |
| 342 bool m_followedRedirect; | 334 bool m_followedRedirect; |
| 343 }; | 335 }; |
| 344 | 336 |
| 345 } // namespace blink | 337 } // namespace blink |
| 346 | 338 |
| 347 #endif // ResourceRequest_h | 339 #endif // ResourceRequest_h |
| OLD | NEW |