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

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

Issue 2053693002: WIP: Move 'Upgrade-Insecure-Requests' to the browser process. Base URL: https://chromium.googlesource.com/chromium/src.git@replicate
Patch Set: Not sure I like this. Created 4 years 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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 return m_document ? m_document->getSecurityOrigin() : nullptr; 860 return m_document ? m_document->getSecurityOrigin() : nullptr;
861 } 861 }
862 862
863 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) { 863 void FrameFetchContext::modifyRequestForCSP(ResourceRequest& resourceRequest) {
864 // Record the latest requiredCSP value that will be used when sending this 864 // Record the latest requiredCSP value that will be used when sending this
865 // request. 865 // request.
866 frame()->loader().recordLatestRequiredCSP(); 866 frame()->loader().recordLatestRequiredCSP();
867 frame()->loader().modifyRequestForCSP(resourceRequest, m_document); 867 frame()->loader().modifyRequestForCSP(resourceRequest, m_document);
868 } 868 }
869 869
870 WebInsecureRequestPolicy FrameFetchContext::getInsecureRequestPolicy() const {
871 // If no document is present (during frame navigation, for instance), use the
872 // FrameLoader's policy.
873 return m_document ? m_document->getInsecureRequestPolicy()
874 : frame()->loader().getInsecureRequestPolicy();
875 }
876
870 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) { 877 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) {
871 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document) 878 if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document)
872 return; 879 return;
873 880
874 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || 881 bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() ||
875 fetchRequest.clientHintsPreferences().shouldSendDPR(); 882 fetchRequest.clientHintsPreferences().shouldSendDPR();
876 bool shouldSendResourceWidth = 883 bool shouldSendResourceWidth =
877 m_document->clientHintsPreferences().shouldSendResourceWidth() || 884 m_document->clientHintsPreferences().shouldSendResourceWidth() ||
878 fetchRequest.clientHintsPreferences().shouldSendResourceWidth(); 885 fetchRequest.clientHintsPreferences().shouldSendResourceWidth();
879 bool shouldSendViewportWidth = 886 bool shouldSendViewportWidth =
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 response); 1033 response);
1027 } 1034 }
1028 1035
1029 DEFINE_TRACE(FrameFetchContext) { 1036 DEFINE_TRACE(FrameFetchContext) {
1030 visitor->trace(m_document); 1037 visitor->trace(m_document);
1031 visitor->trace(m_documentLoader); 1038 visitor->trace(m_documentLoader);
1032 FetchContext::trace(visitor); 1039 FetchContext::trace(visitor);
1033 } 1040 }
1034 1041
1035 } // namespace blink 1042 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698