| 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 11 matching lines...) Expand all Loading... |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 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_hf |
| 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 #include <memory> |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class ResourceRequest; | 42 class ResourceRequest; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 // Used to report performance metrics timed from the UI action that | 130 // Used to report performance metrics timed from the UI action that |
| 131 // triggered them (as opposed to navigation start time used in the | 131 // triggered them (as opposed to navigation start time used in the |
| 132 // Navigation Timing API). | 132 // Navigation Timing API). |
| 133 enum InputToLoadPerfMetricReportPolicy { | 133 enum InputToLoadPerfMetricReportPolicy { |
| 134 NoReport, // Don't report metrics for this WebURLRequest. | 134 NoReport, // Don't report metrics for this WebURLRequest. |
| 135 ReportLink, // Report metrics with UI action link clicked. | 135 ReportLink, // Report metrics with UI action link clicked. |
| 136 ReportIntent, // Report metrics with UI action displayed intent. | 136 ReportIntent, // Report metrics with UI action displayed intent. |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 // The LoFi state which determines whether to request a Lo-Fi version of the | 139 // The Previews state which determines whether to request a Preview version of |
| 140 // resource. | 140 // the resource. |
| 141 enum LoFiState { | 141 enum PreviewsState { |
| 142 LoFiUnspecified, // Let the browser process decide whether or not to | 142 PreviewsUnspecified = 1 << 0, // Let the browser process decide whether or |
| 143 // request the Lo-Fi version. | 143 // not to request Preview types. |
| 144 LoFiOff, // Request a normal (non-Lo-Fi) version of the resource. | 144 ServerLoFiOn = 1 << 1, // Request a Lo-Fi version of the resource |
| 145 LoFiOn, // Request a Lo-Fi version of the resource. | 145 // from the server. |
| 146 ClientLoFiOn = 1 << 2, // Request a Lo-Fi version of the resource |
| 147 // from the client. |
| 148 PreviewsOff = 1 << 3 // Request a normal (non-Preview) version of |
| 149 // the resource. |
| 146 }; | 150 }; |
| 147 | 151 |
| 148 // Indicates which types of ServiceWorkers should skip handling this request. | 152 // Indicates which types of ServiceWorkers should skip handling this request. |
| 149 enum class SkipServiceWorker { | 153 enum class SkipServiceWorker { |
| 150 // Request can be handled both by a controlling same-origin worker and | 154 // Request can be handled both by a controlling same-origin worker and |
| 151 // a cross-origin foreign fetch service worker. | 155 // a cross-origin foreign fetch service worker. |
| 152 None, | 156 None, |
| 153 // Request should not be handled by a same-origin controlling worker, | 157 // Request should not be handled by a same-origin controlling worker, |
| 154 // but can be intercepted by a foreign fetch service worker. | 158 // but can be intercepted by a foreign fetch service worker. |
| 155 Controlling, | 159 Controlling, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode); | 282 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode); |
| 279 | 283 |
| 280 // The credentials mode which will be passed to the ServiceWorker. | 284 // The credentials mode which will be passed to the ServiceWorker. |
| 281 BLINK_PLATFORM_EXPORT FetchCredentialsMode getFetchCredentialsMode() const; | 285 BLINK_PLATFORM_EXPORT FetchCredentialsMode getFetchCredentialsMode() const; |
| 282 BLINK_PLATFORM_EXPORT void setFetchCredentialsMode(FetchCredentialsMode); | 286 BLINK_PLATFORM_EXPORT void setFetchCredentialsMode(FetchCredentialsMode); |
| 283 | 287 |
| 284 // The redirect mode which is used in Fetch API. | 288 // The redirect mode which is used in Fetch API. |
| 285 BLINK_PLATFORM_EXPORT FetchRedirectMode getFetchRedirectMode() const; | 289 BLINK_PLATFORM_EXPORT FetchRedirectMode getFetchRedirectMode() const; |
| 286 BLINK_PLATFORM_EXPORT void setFetchRedirectMode(FetchRedirectMode); | 290 BLINK_PLATFORM_EXPORT void setFetchRedirectMode(FetchRedirectMode); |
| 287 | 291 |
| 288 // The LoFi state which determines whether to request a Lo-Fi version of the | 292 // The Previews state which determines whether to request a Preview version of |
| 289 // resource. | 293 // the resource. |
| 290 BLINK_PLATFORM_EXPORT LoFiState getLoFiState() const; | 294 BLINK_PLATFORM_EXPORT int getPreviewsState() const; |
| 291 BLINK_PLATFORM_EXPORT void setLoFiState(LoFiState); | 295 BLINK_PLATFORM_EXPORT void setPreviewsState(int); |
| 292 | 296 |
| 293 // Extra data associated with the underlying resource request. Resource | 297 // Extra data associated with the underlying resource request. Resource |
| 294 // requests can be copied. If non-null, each copy of a resource requests | 298 // requests can be copied. If non-null, each copy of a resource requests |
| 295 // holds a pointer to the extra data, and the extra data pointer will be | 299 // holds a pointer to the extra data, and the extra data pointer will be |
| 296 // deleted when the last resource request is destroyed. Setting the extra | 300 // deleted when the last resource request is destroyed. Setting the extra |
| 297 // data pointer will cause the underlying resource request to be | 301 // data pointer will cause the underlying resource request to be |
| 298 // dissociated from any existing non-null extra data pointer. | 302 // dissociated from any existing non-null extra data pointer. |
| 299 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; | 303 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; |
| 300 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); | 304 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); |
| 301 | 305 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // instance it contains. | 348 // instance it contains. |
| 345 std::unique_ptr<ResourceRequestContainer> m_ownedResourceRequest; | 349 std::unique_ptr<ResourceRequestContainer> m_ownedResourceRequest; |
| 346 | 350 |
| 347 // Should never be null. | 351 // Should never be null. |
| 348 ResourceRequest* m_resourceRequest; | 352 ResourceRequest* m_resourceRequest; |
| 349 }; | 353 }; |
| 350 | 354 |
| 351 } // namespace blink | 355 } // namespace blink |
| 352 | 356 |
| 353 #endif | 357 #endif |
| OLD | NEW |