| 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 : ErrorMessageLevel; | 830 : ErrorMessageLevel; |
| 831 if (frame()->document()) | 831 if (frame()->document()) |
| 832 frame()->document()->addConsoleMessage( | 832 frame()->document()->addConsoleMessage( |
| 833 ConsoleMessage::create(JSMessageSource, level, message)); | 833 ConsoleMessage::create(JSMessageSource, level, message)); |
| 834 } | 834 } |
| 835 | 835 |
| 836 SecurityOrigin* FrameFetchContext::getSecurityOrigin() const { | 836 SecurityOrigin* FrameFetchContext::getSecurityOrigin() const { |
| 837 return m_document ? m_document->getSecurityOrigin() : nullptr; | 837 return m_document ? m_document->getSecurityOrigin() : nullptr; |
| 838 } | 838 } |
| 839 | 839 |
| 840 void FrameFetchContext::upgradeInsecureRequest( | 840 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) { |
| 841 ResourceRequest& resourceRequest) { | 841 // Record the latest requiredCSP value that will be used when sending this req
uest. |
| 842 frame()->loader().upgradeInsecureRequest(resourceRequest, m_document); | 842 frame()->loader().recordLatestRequiredCSP(); |
| 843 frame()->loader().modifyRequestForCSP(resourceRequest, m_document); |
| 843 } | 844 } |
| 844 | 845 |
| 845 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) { | 846 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) { |
| 846 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) | 847 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) |
| 847 return; | 848 return; |
| 848 | 849 |
| 849 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || | 850 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || |
| 850 fetchRequest.clientHintsPreferences().shouldSendDPR(); | 851 fetchRequest.clientHintsPreferences().shouldSendDPR(); |
| 851 bool shouldSendResourceWidth = | 852 bool shouldSendResourceWidth = |
| 852 m_document->clientHintsPreferences().shouldSendResourceWidth() || | 853 m_document->clientHintsPreferences().shouldSendResourceWidth() || |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 response); | 999 response); |
| 999 } | 1000 } |
| 1000 | 1001 |
| 1001 DEFINE_TRACE(FrameFetchContext) { | 1002 DEFINE_TRACE(FrameFetchContext) { |
| 1002 visitor->trace(m_document); | 1003 visitor->trace(m_document); |
| 1003 visitor->trace(m_documentLoader); | 1004 visitor->trace(m_documentLoader); |
| 1004 FetchContext::trace(visitor); | 1005 FetchContext::trace(visitor); |
| 1005 } | 1006 } |
| 1006 | 1007 |
| 1007 } // namespace blink | 1008 } // namespace blink |
| OLD | NEW |