| 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) 2009, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 setFrameType(data->m_frameType); | 80 setFrameType(data->m_frameType); |
| 81 setFetchRequestMode(data->m_fetchRequestMode); | 81 setFetchRequestMode(data->m_fetchRequestMode); |
| 82 setFetchCredentialsMode(data->m_fetchCredentialsMode); | 82 setFetchCredentialsMode(data->m_fetchCredentialsMode); |
| 83 setFetchRedirectMode(data->m_fetchRedirectMode); | 83 setFetchRedirectMode(data->m_fetchRedirectMode); |
| 84 setLoFiState(data->m_loFiState); | 84 setLoFiState(data->m_loFiState); |
| 85 m_referrerPolicy = data->m_referrerPolicy; | 85 m_referrerPolicy = data->m_referrerPolicy; |
| 86 m_didSetHTTPReferrer = data->m_didSetHTTPReferrer; | 86 m_didSetHTTPReferrer = data->m_didSetHTTPReferrer; |
| 87 m_checkForBrowserSideNavigation = data->m_checkForBrowserSideNavigation; | 87 m_checkForBrowserSideNavigation = data->m_checkForBrowserSideNavigation; |
| 88 m_uiStartTime = data->m_uiStartTime; | 88 m_uiStartTime = data->m_uiStartTime; |
| 89 m_isExternalRequest = data->m_isExternalRequest; | 89 m_isExternalRequest = data->m_isExternalRequest; |
| 90 m_insecureRequestPolicy = data->m_insecureRequestPolicy; |
| 90 m_inputPerfMetricReportPolicy = data->m_inputPerfMetricReportPolicy; | 91 m_inputPerfMetricReportPolicy = data->m_inputPerfMetricReportPolicy; |
| 91 m_redirectStatus = data->m_redirectStatus; | 92 m_redirectStatus = data->m_redirectStatus; |
| 92 } | 93 } |
| 93 | 94 |
| 94 ResourceRequest::ResourceRequest(const ResourceRequest&) = default; | 95 ResourceRequest::ResourceRequest(const ResourceRequest&) = default; |
| 95 | 96 |
| 96 ResourceRequest& ResourceRequest::operator=(const ResourceRequest&) = default; | 97 ResourceRequest& ResourceRequest::operator=(const ResourceRequest&) = default; |
| 97 | 98 |
| 98 std::unique_ptr<CrossThreadResourceRequestData> ResourceRequest::copyData() | 99 std::unique_ptr<CrossThreadResourceRequestData> ResourceRequest::copyData() |
| 99 const { | 100 const { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 128 data->m_frameType = m_frameType; | 129 data->m_frameType = m_frameType; |
| 129 data->m_fetchRequestMode = m_fetchRequestMode; | 130 data->m_fetchRequestMode = m_fetchRequestMode; |
| 130 data->m_fetchCredentialsMode = m_fetchCredentialsMode; | 131 data->m_fetchCredentialsMode = m_fetchCredentialsMode; |
| 131 data->m_fetchRedirectMode = m_fetchRedirectMode; | 132 data->m_fetchRedirectMode = m_fetchRedirectMode; |
| 132 data->m_loFiState = m_loFiState; | 133 data->m_loFiState = m_loFiState; |
| 133 data->m_referrerPolicy = m_referrerPolicy; | 134 data->m_referrerPolicy = m_referrerPolicy; |
| 134 data->m_didSetHTTPReferrer = m_didSetHTTPReferrer; | 135 data->m_didSetHTTPReferrer = m_didSetHTTPReferrer; |
| 135 data->m_checkForBrowserSideNavigation = m_checkForBrowserSideNavigation; | 136 data->m_checkForBrowserSideNavigation = m_checkForBrowserSideNavigation; |
| 136 data->m_uiStartTime = m_uiStartTime; | 137 data->m_uiStartTime = m_uiStartTime; |
| 137 data->m_isExternalRequest = m_isExternalRequest; | 138 data->m_isExternalRequest = m_isExternalRequest; |
| 139 data->m_insecureRequestPolicy = m_insecureRequestPolicy; |
| 138 data->m_inputPerfMetricReportPolicy = m_inputPerfMetricReportPolicy; | 140 data->m_inputPerfMetricReportPolicy = m_inputPerfMetricReportPolicy; |
| 139 data->m_redirectStatus = m_redirectStatus; | 141 data->m_redirectStatus = m_redirectStatus; |
| 140 return data; | 142 return data; |
| 141 } | 143 } |
| 142 | 144 |
| 143 bool ResourceRequest::isEmpty() const { | 145 bool ResourceRequest::isEmpty() const { |
| 144 return m_url.isEmpty(); | 146 return m_url.isEmpty(); |
| 145 } | 147 } |
| 146 | 148 |
| 147 bool ResourceRequest::isNull() const { | 149 bool ResourceRequest::isNull() const { |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 m_frameType = WebURLRequest::FrameTypeNone; | 401 m_frameType = WebURLRequest::FrameTypeNone; |
| 400 m_fetchRequestMode = WebURLRequest::FetchRequestModeNoCORS; | 402 m_fetchRequestMode = WebURLRequest::FetchRequestModeNoCORS; |
| 401 m_fetchCredentialsMode = WebURLRequest::FetchCredentialsModeInclude; | 403 m_fetchCredentialsMode = WebURLRequest::FetchCredentialsModeInclude; |
| 402 m_fetchRedirectMode = WebURLRequest::FetchRedirectModeFollow; | 404 m_fetchRedirectMode = WebURLRequest::FetchRedirectModeFollow; |
| 403 m_referrerPolicy = ReferrerPolicyDefault; | 405 m_referrerPolicy = ReferrerPolicyDefault; |
| 404 m_loFiState = WebURLRequest::LoFiUnspecified; | 406 m_loFiState = WebURLRequest::LoFiUnspecified; |
| 405 m_didSetHTTPReferrer = false; | 407 m_didSetHTTPReferrer = false; |
| 406 m_checkForBrowserSideNavigation = true; | 408 m_checkForBrowserSideNavigation = true; |
| 407 m_uiStartTime = 0; | 409 m_uiStartTime = 0; |
| 408 m_isExternalRequest = false; | 410 m_isExternalRequest = false; |
| 411 m_insecureRequestPolicy = kLeaveInsecureRequestsAlone; |
| 409 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; | 412 m_inputPerfMetricReportPolicy = InputToLoadPerfMetricReportPolicy::NoReport; |
| 410 m_redirectStatus = RedirectStatus::NoRedirect; | 413 m_redirectStatus = RedirectStatus::NoRedirect; |
| 411 m_requestorOrigin = SecurityOrigin::createUnique(); | 414 m_requestorOrigin = SecurityOrigin::createUnique(); |
| 412 } | 415 } |
| 413 | 416 |
| 414 bool ResourceRequest::needsHTTPOrigin() const { | 417 bool ResourceRequest::needsHTTPOrigin() const { |
| 415 if (!httpOrigin().isEmpty()) | 418 if (!httpOrigin().isEmpty()) |
| 416 return false; // Request already has an Origin header. | 419 return false; // Request already has an Origin header. |
| 417 | 420 |
| 418 // Don't send an Origin header for GET or HEAD to avoid privacy issues. | 421 // Don't send an Origin header for GET or HEAD to avoid privacy issues. |
| 419 // For example, if an intranet page has a hyperlink to an external web | 422 // For example, if an intranet page has a hyperlink to an external web |
| 420 // site, we don't want to include the Origin of the request because it | 423 // site, we don't want to include the Origin of the request because it |
| 421 // will leak the internal host name. Similar privacy concerns have lead | 424 // will leak the internal host name. Similar privacy concerns have lead |
| 422 // to the widespread suppression of the Referer header at the network | 425 // to the widespread suppression of the Referer header at the network |
| 423 // layer. | 426 // layer. |
| 424 if (httpMethod() == HTTPNames::GET || httpMethod() == HTTPNames::HEAD) | 427 if (httpMethod() == HTTPNames::GET || httpMethod() == HTTPNames::HEAD) |
| 425 return false; | 428 return false; |
| 426 | 429 |
| 427 // For non-GET and non-HEAD methods, always send an Origin header so the | 430 // For non-GET and non-HEAD methods, always send an Origin header so the |
| 428 // server knows we support this feature. | 431 // server knows we support this feature. |
| 429 return true; | 432 return true; |
| 430 } | 433 } |
| 431 | 434 |
| 432 } // namespace blink | 435 } // namespace blink |
| OLD | NEW |