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

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: Rebase. :( Created 3 years, 9 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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698