| 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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 return m_document ? m_document->getSecurityOrigin() : nullptr; | 862 return m_document ? m_document->getSecurityOrigin() : nullptr; |
| 863 } | 863 } |
| 864 | 864 |
| 865 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) { | 865 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) { |
| 866 // Record the latest requiredCSP value that will be used when sending this | 866 // Record the latest requiredCSP value that will be used when sending this |
| 867 // request. | 867 // request. |
| 868 frame()->loader().recordLatestRequiredCSP(); | 868 frame()->loader().recordLatestRequiredCSP(); |
| 869 frame()->loader().modifyRequestForCSP(resourceRequest, m_document); | 869 frame()->loader().modifyRequestForCSP(resourceRequest, m_document); |
| 870 } | 870 } |
| 871 | 871 |
| 872 WebInsecureRequestPolicy FrameFetchContext::getInsecureRequestPolicy() const { |
| 873 // If no document is present (during frame navigation, for instance), use the |
| 874 // FrameLoader's policy. |
| 875 return m_document ? m_document->getInsecureRequestPolicy() |
| 876 : frame()->loader().getInsecureRequestPolicy(); |
| 877 } |
| 878 |
| 872 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) { | 879 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) { |
| 873 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) | 880 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) |
| 874 return; | 881 return; |
| 875 | 882 |
| 876 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || | 883 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || |
| 877 fetchRequest.clientHintsPreferences().shouldSendDPR(); | 884 fetchRequest.clientHintsPreferences().shouldSendDPR(); |
| 878 bool shouldSendResourceWidth = | 885 bool shouldSendResourceWidth = |
| 879 m_document->clientHintsPreferences().shouldSendResourceWidth() || | 886 m_document->clientHintsPreferences().shouldSendResourceWidth() || |
| 880 fetchRequest.clientHintsPreferences().shouldSendResourceWidth(); | 887 fetchRequest.clientHintsPreferences().shouldSendResourceWidth(); |
| 881 bool shouldSendViewportWidth = | 888 bool shouldSendViewportWidth = |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 response); | 1021 response); |
| 1015 } | 1022 } |
| 1016 | 1023 |
| 1017 DEFINE_TRACE(FrameFetchContext) { | 1024 DEFINE_TRACE(FrameFetchContext) { |
| 1018 visitor->trace(m_document); | 1025 visitor->trace(m_document); |
| 1019 visitor->trace(m_documentLoader); | 1026 visitor->trace(m_documentLoader); |
| 1020 FetchContext::trace(visitor); | 1027 FetchContext::trace(visitor); |
| 1021 } | 1028 } |
| 1022 | 1029 |
| 1023 } // namespace blink | 1030 } // namespace blink |
| OLD | NEW |