| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 return m_document ? m_document->getSecurityOrigin() : nullptr; | 944 return m_document ? m_document->getSecurityOrigin() : nullptr; |
| 945 } | 945 } |
| 946 | 946 |
| 947 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) { | 947 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) { |
| 948 // Record the latest requiredCSP value that will be used when sending this | 948 // Record the latest requiredCSP value that will be used when sending this |
| 949 // request. | 949 // request. |
| 950 frame()->loader().recordLatestRequiredCSP(); | 950 frame()->loader().recordLatestRequiredCSP(); |
| 951 frame()->loader().modifyRequestForCSP(resourceRequest, m_document); | 951 frame()->loader().modifyRequestForCSP(resourceRequest, m_document); |
| 952 } | 952 } |
| 953 | 953 |
| 954 WebInsecureRequestPolicy FrameFetchContext::getInsecureRequestPolicy() const { |
| 955 // If no document is present (during frame navigation, for instance), use the |
| 956 // FrameLoader's policy. |
| 957 return m_document ? m_document->getInsecureRequestPolicy() |
| 958 : frame()->loader().getInsecureRequestPolicy(); |
| 959 } |
| 960 |
| 954 void FrameFetchContext::addClientHintsIfNecessary( | 961 void FrameFetchContext::addClientHintsIfNecessary( |
| 955 const ClientHintsPreferences& hintsPreferences, | 962 const ClientHintsPreferences& hintsPreferences, |
| 956 const FetchRequest::ResourceWidth& resourceWidth, | 963 const FetchRequest::ResourceWidth& resourceWidth, |
| 957 ResourceRequest& request) { | 964 ResourceRequest& request) { |
| 958 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) | 965 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) |
| 959 return; | 966 return; |
| 960 | 967 |
| 961 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || | 968 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || |
| 962 hintsPreferences.shouldSendDPR(); | 969 hintsPreferences.shouldSendDPR(); |
| 963 bool shouldSendResourceWidth = | 970 bool shouldSendResourceWidth = |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 response); | 1117 response); |
| 1111 } | 1118 } |
| 1112 | 1119 |
| 1113 DEFINE_TRACE(FrameFetchContext) { | 1120 DEFINE_TRACE(FrameFetchContext) { |
| 1114 visitor->trace(m_document); | 1121 visitor->trace(m_document); |
| 1115 visitor->trace(m_documentLoader); | 1122 visitor->trace(m_documentLoader); |
| 1116 FetchContext::trace(visitor); | 1123 FetchContext::trace(visitor); |
| 1117 } | 1124 } |
| 1118 | 1125 |
| 1119 } // namespace blink | 1126 } // namespace blink |
| OLD | NEW |