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

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

Issue 2053693002: WIP: Move 'Upgrade-Insecure-Requests' to the browser process. Base URL: https://chromium.googlesource.com/chromium/src.git@replicate
Patch Set: DCHECK. 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 1908
1909 // If we don't yet have an |m_document| (because we're loading an iframe, for 1909 // If we don't yet have an |m_document| (because we're loading an iframe, for
1910 // instance), check the FrameLoader's policy. 1910 // instance), check the FrameLoader's policy.
1911 WebInsecureRequestPolicy relevantPolicy = 1911 WebInsecureRequestPolicy relevantPolicy =
1912 document ? document->getInsecureRequestPolicy() 1912 document ? document->getInsecureRequestPolicy()
1913 : getInsecureRequestPolicy(); 1913 : getInsecureRequestPolicy();
1914 SecurityContext::InsecureNavigationsSet* relevantNavigationSet = 1914 SecurityContext::InsecureNavigationsSet* relevantNavigationSet =
1915 document ? document->insecureNavigationsToUpgrade() 1915 document ? document->insecureNavigationsToUpgrade()
1916 : insecureNavigationsToUpgrade(); 1916 : insecureNavigationsToUpgrade();
1917 1917
1918 resourceRequest.setInsecureRequestPolicy(relevantPolicy);
1919
1918 if (url.protocolIs("http") && relevantPolicy & kUpgradeInsecureRequests) { 1920 if (url.protocolIs("http") && relevantPolicy & kUpgradeInsecureRequests) {
1919 // We always upgrade requests that meet any of the following criteria: 1921 // We always upgrade requests that meet any of the following criteria:
1920 // 1922 //
1921 // 1. Are for subresources (including nested frames). 1923 // 1. Are for subresources (including nested frames).
1922 // 2. Are form submissions. 1924 // 2. Are form submissions.
1923 // 3. Whose hosts are contained in the document's InsecureNavigationSet. 1925 // 3. Whose hosts are contained in the document's InsecureNavigationSet.
1924 if (resourceRequest.frameType() == WebURLRequest::FrameTypeNone || 1926 if (resourceRequest.frameType() == WebURLRequest::FrameTypeNone ||
1925 resourceRequest.frameType() == WebURLRequest::FrameTypeNested || 1927 resourceRequest.frameType() == WebURLRequest::FrameTypeNested ||
1926 resourceRequest.requestContext() == WebURLRequest::RequestContextForm || 1928 resourceRequest.requestContext() == WebURLRequest::RequestContextForm ||
1927 (!url.host().isNull() && 1929 (!url.host().isNull() &&
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 m_documentLoader ? m_documentLoader->url() : String()); 1961 m_documentLoader ? m_documentLoader->url() : String());
1960 return tracedValue; 1962 return tracedValue;
1961 } 1963 }
1962 1964
1963 inline void FrameLoader::takeObjectSnapshot() const { 1965 inline void FrameLoader::takeObjectSnapshot() const {
1964 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1966 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1965 toTracedValue()); 1967 toTracedValue());
1966 } 1968 }
1967 1969
1968 } // namespace blink 1970 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698