Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2372563002: Adding Embedding-CSP HTTP header (Closed)
Patch Set: Moving requiredCSP to FrameLoader Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageS ource, level, message)); 692 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageS ource, level, message));
693 } 693 }
694 694
695 SecurityOrigin* FrameFetchContext::getSecurityOrigin() const 695 SecurityOrigin* FrameFetchContext::getSecurityOrigin() const
696 { 696 {
697 return m_document ? m_document->getSecurityOrigin() : nullptr; 697 return m_document ? m_document->getSecurityOrigin() : nullptr;
698 } 698 }
699 699
700 void FrameFetchContext::upgradeInsecureRequest(ResourceRequest& resourceRequest) 700 void FrameFetchContext::upgradeInsecureRequest(ResourceRequest& resourceRequest)
701 { 701 {
702 frame()->loader().upgradeInsecureRequest(resourceRequest, m_document); 702 // Record the latest requiredCSP value that will be used when sending this r equest.
703 frame()->loader().recordLatestRequiredCSP();
704 frame()->loader().addOutgoingSecurityHeaders(resourceRequest, m_document);
Mike West 2016/09/30 13:11:49 This seems strange. I don't know why we call into
703 } 705 }
704 706
705 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) 707 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest)
706 { 708 {
707 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) 709 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document)
708 return; 710 return;
709 711
710 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || fetchRequest.clientHintsPreferences().shouldSendDPR(); 712 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || fetchRequest.clientHintsPreferences().shouldSendDPR();
711 bool shouldSendResourceWidth = m_document->clientHintsPreferences().shouldSe ndResourceWidth() || fetchRequest.clientHintsPreferences().shouldSendResourceWid th(); 713 bool shouldSendResourceWidth = m_document->clientHintsPreferences().shouldSe ndResourceWidth() || fetchRequest.clientHintsPreferences().shouldSendResourceWid th();
712 bool shouldSendViewportWidth = m_document->clientHintsPreferences().shouldSe ndViewportWidth() || fetchRequest.clientHintsPreferences().shouldSendViewportWid th(); 714 bool shouldSendViewportWidth = m_document->clientHintsPreferences().shouldSe ndViewportWidth() || fetchRequest.clientHintsPreferences().shouldSendViewportWid th();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 } 834 }
833 835
834 DEFINE_TRACE(FrameFetchContext) 836 DEFINE_TRACE(FrameFetchContext)
835 { 837 {
836 visitor->trace(m_document); 838 visitor->trace(m_document);
837 visitor->trace(m_documentLoader); 839 visitor->trace(m_documentLoader);
838 FetchContext::trace(visitor); 840 FetchContext::trace(visitor);
839 } 841 }
840 842
841 } // namespace blink 843 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698