| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 17 matching lines...) Expand all Loading... |
| 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 WebURLRequest_h | 31 #ifndef WebURLRequest_h |
| 32 #define WebURLRequest_h | 32 #define WebURLRequest_h |
| 33 | 33 |
| 34 #include "WebAddressSpace.h" | 34 #include "WebAddressSpace.h" |
| 35 #include "WebCommon.h" | 35 #include "WebCommon.h" |
| 36 #include "WebHTTPBody.h" | 36 #include "WebHTTPBody.h" |
| 37 #include "WebReferrerPolicy.h" | 37 #include "WebReferrerPolicy.h" |
| 38 #include <memory> |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 class ResourceRequest; | 42 class ResourceRequest; |
| 42 class WebHTTPBody; | 43 class WebHTTPBody; |
| 43 class WebHTTPHeaderVisitor; | 44 class WebHTTPHeaderVisitor; |
| 44 class WebSecurityOrigin; | 45 class WebSecurityOrigin; |
| 45 class WebString; | 46 class WebString; |
| 46 class WebURL; | 47 class WebURL; |
| 47 class WebURLRequestPrivate; | |
| 48 enum class WebCachePolicy; | 48 enum class WebCachePolicy; |
| 49 | 49 |
| 50 class WebURLRequest { | 50 class WebURLRequest { |
| 51 public: | 51 public: |
| 52 enum Priority { | 52 enum Priority { |
| 53 PriorityUnresolved = -1, | 53 PriorityUnresolved = -1, |
| 54 PriorityVeryLow, | 54 PriorityVeryLow, |
| 55 PriorityLow, | 55 PriorityLow, |
| 56 PriorityMedium, | 56 PriorityMedium, |
| 57 PriorityHigh, | 57 PriorityHigh, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 Controlling, | 151 Controlling, |
| 152 // Request should skip all possible service workers. | 152 // Request should skip all possible service workers. |
| 153 All | 153 All |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 class ExtraData { | 156 class ExtraData { |
| 157 public: | 157 public: |
| 158 virtual ~ExtraData() { } | 158 virtual ~ExtraData() { } |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 ~WebURLRequest() { reset(); } | 161 BLINK_PLATFORM_EXPORT ~WebURLRequest(); |
| 162 | 162 BLINK_PLATFORM_EXPORT WebURLRequest(); |
| 163 WebURLRequest() : m_private(0) { } | 163 BLINK_PLATFORM_EXPORT WebURLRequest(const WebURLRequest&); |
| 164 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } | 164 BLINK_PLATFORM_EXPORT explicit WebURLRequest(const WebURL&); |
| 165 WebURLRequest& operator=(const WebURLRequest& r) | 165 BLINK_PLATFORM_EXPORT WebURLRequest& operator=(const WebURLRequest&); |
| 166 { | |
| 167 assign(r); | |
| 168 return *this; | |
| 169 } | |
| 170 | |
| 171 explicit WebURLRequest(const WebURL& url) : m_private(0) | |
| 172 { | |
| 173 initialize(); | |
| 174 setURL(url); | |
| 175 } | |
| 176 | |
| 177 BLINK_PLATFORM_EXPORT void initialize(); | |
| 178 BLINK_PLATFORM_EXPORT void reset(); | |
| 179 BLINK_PLATFORM_EXPORT void assign(const WebURLRequest&); | |
| 180 | 166 |
| 181 BLINK_PLATFORM_EXPORT bool isNull() const; | 167 BLINK_PLATFORM_EXPORT bool isNull() const; |
| 182 | 168 |
| 183 BLINK_PLATFORM_EXPORT WebURL url() const; | 169 BLINK_PLATFORM_EXPORT WebURL url() const; |
| 184 BLINK_PLATFORM_EXPORT void setURL(const WebURL&); | 170 BLINK_PLATFORM_EXPORT void setURL(const WebURL&); |
| 185 | 171 |
| 186 // Used to implement third-party cookie blocking. | 172 // Used to implement third-party cookie blocking. |
| 187 BLINK_PLATFORM_EXPORT WebURL firstPartyForCookies() const; | 173 BLINK_PLATFORM_EXPORT WebURL firstPartyForCookies() const; |
| 188 BLINK_PLATFORM_EXPORT void setFirstPartyForCookies(const WebURL&); | 174 BLINK_PLATFORM_EXPORT void setFirstPartyForCookies(const WebURL&); |
| 189 | 175 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 BLINK_PLATFORM_EXPORT void setUiStartTime(double); | 302 BLINK_PLATFORM_EXPORT void setUiStartTime(double); |
| 317 BLINK_PLATFORM_EXPORT WebURLRequest::InputToLoadPerfMetricReportPolicy input
PerfMetricReportPolicy() const; | 303 BLINK_PLATFORM_EXPORT WebURLRequest::InputToLoadPerfMetricReportPolicy input
PerfMetricReportPolicy() const; |
| 318 BLINK_PLATFORM_EXPORT void setInputPerfMetricReportPolicy(WebURLRequest::Inp
utToLoadPerfMetricReportPolicy); | 304 BLINK_PLATFORM_EXPORT void setInputPerfMetricReportPolicy(WebURLRequest::Inp
utToLoadPerfMetricReportPolicy); |
| 319 | 305 |
| 320 // https://mikewest.github.io/cors-rfc1918/#external-request | 306 // https://mikewest.github.io/cors-rfc1918/#external-request |
| 321 BLINK_PLATFORM_EXPORT bool isExternalRequest() const; | 307 BLINK_PLATFORM_EXPORT bool isExternalRequest() const; |
| 322 | 308 |
| 323 #if INSIDE_BLINK | 309 #if INSIDE_BLINK |
| 324 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest(); | 310 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest(); |
| 325 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const; | 311 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const; |
| 312 |
| 313 protected: |
| 314 // Permit subclasses to set arbitrary ResourceRequest pointer as |
| 315 // |m_resourceRequest|. |m_ownedResourceRequest| is not set in this case. |
| 316 BLINK_PLATFORM_EXPORT explicit WebURLRequest(ResourceRequest&); |
| 326 #endif | 317 #endif |
| 327 | 318 |
| 328 protected: | 319 private: |
| 329 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); | 320 struct ResourceRequestContainer; |
| 330 | 321 |
| 331 private: | 322 // If this instance owns a ResourceRequest then |m_ownedResourceRequest| |
| 332 WebURLRequestPrivate* m_private; | 323 // is non-null and |m_resourceRequest| points to the ResourceRequest |
| 324 // instance it contains. |
| 325 std::unique_ptr<ResourceRequestContainer> m_ownedResourceRequest; |
| 326 |
| 327 // Should never be null. |
| 328 ResourceRequest* m_resourceRequest; |
| 333 }; | 329 }; |
| 334 | 330 |
| 335 } // namespace blink | 331 } // namespace blink |
| 336 | 332 |
| 337 #endif | 333 #endif |
| OLD | NEW |