| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 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 WebURLRequest_h | 31 #ifndef WebURLRequest_h |
| 32 #define WebURLRequest_h | 32 #define WebURLRequest_h |
| 33 | 33 |
| 34 #include <memory> |
| 34 #include "WebAddressSpace.h" | 35 #include "WebAddressSpace.h" |
| 36 #include "WebCachePolicy.h" |
| 35 #include "WebCommon.h" | 37 #include "WebCommon.h" |
| 36 #include "WebHTTPBody.h" | 38 #include "WebHTTPBody.h" |
| 37 #include "WebReferrerPolicy.h" | 39 #include "WebReferrerPolicy.h" |
| 38 #include <memory> | |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class ResourceRequest; | 43 class ResourceRequest; |
| 43 class WebHTTPBody; | 44 class WebHTTPBody; |
| 44 class WebHTTPHeaderVisitor; | 45 class WebHTTPHeaderVisitor; |
| 45 class WebSecurityOrigin; | 46 class WebSecurityOrigin; |
| 46 class WebString; | 47 class WebString; |
| 47 class WebURL; | 48 class WebURL; |
| 48 enum class WebCachePolicy; | |
| 49 | 49 |
| 50 class WebURLRequest { | 50 class WebURLRequest { |
| 51 public: | 51 public: |
| 52 enum Priority { | 52 enum Priority { |
| 53 kPriorityUnresolved = -1, | 53 kPriorityUnresolved = -1, |
| 54 kPriorityVeryLow, | 54 kPriorityVeryLow, |
| 55 kPriorityLow, | 55 kPriorityLow, |
| 56 kPriorityMedium, | 56 kPriorityMedium, |
| 57 kPriorityHigh, | 57 kPriorityHigh, |
| 58 kPriorityVeryHigh, | 58 kPriorityVeryHigh, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 // Corresponds to Fetch's "context": | 61 // Corresponds to Fetch's "context": |
| 62 // http://fetch.spec.whatwg.org/#concept-request-context | 62 // http://fetch.spec.whatwg.org/#concept-request-context |
| 63 enum RequestContext { | 63 enum RequestContext : uint8_t { |
| 64 kRequestContextUnspecified = 0, | 64 kRequestContextUnspecified = 0, |
| 65 kRequestContextAudio, | 65 kRequestContextAudio, |
| 66 kRequestContextBeacon, | 66 kRequestContextBeacon, |
| 67 kRequestContextCSPReport, | 67 kRequestContextCSPReport, |
| 68 kRequestContextDownload, | 68 kRequestContextDownload, |
| 69 kRequestContextEmbed, | 69 kRequestContextEmbed, |
| 70 kRequestContextEventSource, | 70 kRequestContextEventSource, |
| 71 kRequestContextFavicon, | 71 kRequestContextFavicon, |
| 72 kRequestContextFetch, | 72 kRequestContextFetch, |
| 73 kRequestContextFont, | 73 kRequestContextFont, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 92 kRequestContextStyle, | 92 kRequestContextStyle, |
| 93 kRequestContextTrack, | 93 kRequestContextTrack, |
| 94 kRequestContextVideo, | 94 kRequestContextVideo, |
| 95 kRequestContextWorker, | 95 kRequestContextWorker, |
| 96 kRequestContextXMLHttpRequest, | 96 kRequestContextXMLHttpRequest, |
| 97 kRequestContextXSLT | 97 kRequestContextXSLT |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // Corresponds to Fetch's "context frame type": | 100 // Corresponds to Fetch's "context frame type": |
| 101 // http://fetch.spec.whatwg.org/#concept-request-context-frame-type | 101 // http://fetch.spec.whatwg.org/#concept-request-context-frame-type |
| 102 enum FrameType { | 102 enum FrameType : uint8_t { |
| 103 kFrameTypeAuxiliary, | 103 kFrameTypeAuxiliary, |
| 104 kFrameTypeNested, | 104 kFrameTypeNested, |
| 105 kFrameTypeNone, | 105 kFrameTypeNone, |
| 106 kFrameTypeTopLevel | 106 kFrameTypeTopLevel |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 enum FetchRequestMode { | 109 enum FetchRequestMode : uint8_t { |
| 110 kFetchRequestModeSameOrigin, | 110 kFetchRequestModeSameOrigin, |
| 111 kFetchRequestModeNoCORS, | 111 kFetchRequestModeNoCORS, |
| 112 kFetchRequestModeCORS, | 112 kFetchRequestModeCORS, |
| 113 kFetchRequestModeCORSWithForcedPreflight, | 113 kFetchRequestModeCORSWithForcedPreflight, |
| 114 kFetchRequestModeNavigate | 114 kFetchRequestModeNavigate |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 enum FetchCredentialsMode { | 117 enum FetchCredentialsMode : uint8_t { |
| 118 kFetchCredentialsModeOmit, | 118 kFetchCredentialsModeOmit, |
| 119 kFetchCredentialsModeSameOrigin, | 119 kFetchCredentialsModeSameOrigin, |
| 120 kFetchCredentialsModeInclude, | 120 kFetchCredentialsModeInclude, |
| 121 kFetchCredentialsModePassword | 121 kFetchCredentialsModePassword |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 enum FetchRequestCacheMode { | 124 enum FetchRequestCacheMode : uint8_t { |
| 125 kFetchRequestCacheModeDefault, | 125 kFetchRequestCacheModeDefault, |
| 126 kFetchRequestCacheModeNoStore, | 126 kFetchRequestCacheModeNoStore, |
| 127 kFetchRequestCacheModeReload, | 127 kFetchRequestCacheModeReload, |
| 128 kFetchRequestCacheModeNoCache, | 128 kFetchRequestCacheModeNoCache, |
| 129 kFetchRequestCacheModeForceCache, | 129 kFetchRequestCacheModeForceCache, |
| 130 kFetchRequestCacheModeOnlyIfCached | 130 kFetchRequestCacheModeOnlyIfCached |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 enum FetchRedirectMode { | 133 enum FetchRedirectMode : uint8_t { |
| 134 kFetchRedirectModeFollow, | 134 kFetchRedirectModeFollow, |
| 135 kFetchRedirectModeError, | 135 kFetchRedirectModeError, |
| 136 kFetchRedirectModeManual | 136 kFetchRedirectModeManual |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 // Used to report performance metrics timed from the UI action that | 139 // Used to report performance metrics timed from the UI action that |
| 140 // triggered them (as opposed to navigation start time used in the | 140 // triggered them (as opposed to navigation start time used in the |
| 141 // Navigation Timing API). | 141 // Navigation Timing API). |
| 142 enum InputToLoadPerfMetricReportPolicy { | 142 enum InputToLoadPerfMetricReportPolicy : uint8_t { |
| 143 kNoReport, // Don't report metrics for this WebURLRequest. | 143 kNoReport, // Don't report metrics for this WebURLRequest. |
| 144 kReportLink, // Report metrics with UI action link clicked. | 144 kReportLink, // Report metrics with UI action link clicked. |
| 145 kReportIntent, // Report metrics with UI action displayed intent. | 145 kReportIntent, // Report metrics with UI action displayed intent. |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 typedef int PreviewsState; | 148 typedef int PreviewsState; |
| 149 | 149 |
| 150 // The Previews types which determines whether to request a Preview version of | 150 // The Previews types which determines whether to request a Preview version of |
| 151 // the resource. | 151 // the resource. |
| 152 enum PreviewsTypes { | 152 enum PreviewsTypes { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 163 // resource from the server. | 163 // resource from the server. |
| 164 kPreviewsNoTransform = 1 << 4, // Explicitly forbid Previews | 164 kPreviewsNoTransform = 1 << 4, // Explicitly forbid Previews |
| 165 // transformations. | 165 // transformations. |
| 166 kPreviewsOff = 1 << 5, // Request a normal (non-Preview) version of | 166 kPreviewsOff = 1 << 5, // Request a normal (non-Preview) version of |
| 167 // the resource. Server transformations may | 167 // the resource. Server transformations may |
| 168 // still happen if the page is heavy. | 168 // still happen if the page is heavy. |
| 169 kPreviewsStateLast = kPreviewsOff | 169 kPreviewsStateLast = kPreviewsOff |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 // Indicates which service workers will receive fetch events for this request. | 172 // Indicates which service workers will receive fetch events for this request. |
| 173 enum class ServiceWorkerMode { | 173 enum class ServiceWorkerMode : uint8_t { |
| 174 // Relevant local and foreign service workers will get a fetch or | 174 // Relevant local and foreign service workers will get a fetch or |
| 175 // foreignfetch event for this request. | 175 // foreignfetch event for this request. |
| 176 kAll, | 176 kAll, |
| 177 // Only relevant foreign service workers will get a foreignfetch event for | 177 // Only relevant foreign service workers will get a foreignfetch event for |
| 178 // this request. | 178 // this request. |
| 179 kForeign, | 179 kForeign, |
| 180 // Neither local nor foreign service workers will get events for this | 180 // Neither local nor foreign service workers will get events for this |
| 181 // request. | 181 // request. |
| 182 kNone | 182 kNone |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 enum class LoadingIPCType { | 185 enum class LoadingIPCType : uint8_t { |
| 186 kChromeIPC, | 186 kChromeIPC, |
| 187 kMojo, | 187 kMojo, |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 class ExtraData { | 190 class ExtraData { |
| 191 public: | 191 public: |
| 192 virtual ~ExtraData() {} | 192 virtual ~ExtraData() {} |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 BLINK_PLATFORM_EXPORT ~WebURLRequest(); | 195 BLINK_PLATFORM_EXPORT ~WebURLRequest(); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // instance it contains. | 381 // instance it contains. |
| 382 std::unique_ptr<ResourceRequestContainer> owned_resource_request_; | 382 std::unique_ptr<ResourceRequestContainer> owned_resource_request_; |
| 383 | 383 |
| 384 // Should never be null. | 384 // Should never be null. |
| 385 ResourceRequest* resource_request_; | 385 ResourceRequest* resource_request_; |
| 386 }; | 386 }; |
| 387 | 387 |
| 388 } // namespace blink | 388 } // namespace blink |
| 389 | 389 |
| 390 #endif | 390 #endif |
| OLD | NEW |