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

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

Issue 2453093003: child-src and frame-src CSP are not applicable when navigating a new window. (Closed)
Patch Set: Address a CR feedback nit - get rid of unnecessary parens. Created 4 years, 1 month 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 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 NavigationPolicy policy, 1557 NavigationPolicy policy,
1558 bool replacesCurrentHistoryItem, 1558 bool replacesCurrentHistoryItem,
1559 bool isClientRedirect, 1559 bool isClientRedirect,
1560 HTMLFormElement* form) { 1560 HTMLFormElement* form) {
1561 m_isNavigationHandledByClient = false; 1561 m_isNavigationHandledByClient = false;
1562 1562
1563 // Don't ask if we are loading an empty URL. 1563 // Don't ask if we are loading an empty URL.
1564 if (request.url().isEmpty() || substituteData.isValid()) 1564 if (request.url().isEmpty() || substituteData.isValid())
1565 return true; 1565 return true;
1566 1566
1567 // If we're loading content into a subframe, check against the parent's 1567 // If we're loading content into |m_frame| (NavigationPolicyCurrentTab), check
1568 // Content Security Policy and kill the load if that check fails, unless we 1568 // against the parent's Content Security Policy and kill the load if that
1569 // should bypass the main world's CSP. 1569 // check fails, unless we should bypass the main world's CSP.
1570 if (shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy) { 1570 if (policy == NavigationPolicyCurrentTab &&
1571 shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy) {
1571 Frame* parentFrame = m_frame->tree().parent(); 1572 Frame* parentFrame = m_frame->tree().parent();
1572 if (parentFrame) { 1573 if (parentFrame) {
1573 ContentSecurityPolicy* parentPolicy = 1574 ContentSecurityPolicy* parentPolicy =
1574 parentFrame->securityContext()->contentSecurityPolicy(); 1575 parentFrame->securityContext()->contentSecurityPolicy();
1575 if (!parentPolicy->allowChildFrameFromSource(request.url(), 1576 if (!parentPolicy->allowChildFrameFromSource(request.url(),
1576 request.redirectStatus())) { 1577 request.redirectStatus())) {
1577 // Fire a load event, as timing attacks would otherwise reveal that the 1578 // Fire a load event, as timing attacks would otherwise reveal that the
1578 // frame was blocked. This way, it looks like every other cross-origin 1579 // frame was blocked. This way, it looks like every other cross-origin
1579 // page load. 1580 // page load.
1580 m_frame->document()->enforceSandboxFlags(SandboxOrigin); 1581 m_frame->document()->enforceSandboxFlags(SandboxOrigin);
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 m_documentLoader ? m_documentLoader->url() : String()); 1934 m_documentLoader ? m_documentLoader->url() : String());
1934 return tracedValue; 1935 return tracedValue;
1935 } 1936 }
1936 1937
1937 inline void FrameLoader::takeObjectSnapshot() const { 1938 inline void FrameLoader::takeObjectSnapshot() const {
1938 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1939 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1939 toTracedValue()); 1940 toTracedValue());
1940 } 1941 }
1941 1942
1942 } // namespace blink 1943 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/frame-src-vs-shift-click-target.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698