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

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

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Duplicate tests with a redirect. 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) 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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 m_frame->document()->enforceSandboxFlags(SandboxOrigin); 1655 m_frame->document()->enforceSandboxFlags(SandboxOrigin);
1656 m_frame->owner()->dispatchLoad(); 1656 m_frame->owner()->dispatchLoad();
1657 return NavigationPolicyIgnore; 1657 return NavigationPolicyIgnore;
1658 } 1658 }
1659 } 1659 }
1660 } 1660 }
1661 1661
1662 bool isFormSubmission = type == NavigationTypeFormSubmitted || 1662 bool isFormSubmission = type == NavigationTypeFormSubmitted ||
1663 type == NavigationTypeFormResubmitted; 1663 type == NavigationTypeFormResubmitted;
1664 if (isFormSubmission && 1664 if (isFormSubmission &&
1665 // 'form-action' check in the frame that is navigating is disabled on the
1666 // renderer side when PlzNavigate is enabled, but is enforced on the
1667 // browser side instead.
1668 // N.B. check in the frame that initiate the navigation stills occurs in
1669 // blink and is not enforced on the browser-side.
1670 // See https://crbug.com/700964
1671 !browserSideNavigationEnabled &&
Mike West 2017/03/14 15:45:39 I'm fine with leaving this in, as long as we figur
arthursonzogni 2017/03/15 13:15:09 Done. BUG and TODO added.
1665 !m_frame->document()->contentSecurityPolicy()->allowFormAction( 1672 !m_frame->document()->contentSecurityPolicy()->allowFormAction(
1666 request.url())) 1673 request.url()))
1667 return NavigationPolicyIgnore; 1674 return NavigationPolicyIgnore;
1668 1675
1669 bool replacesCurrentHistoryItem = 1676 bool replacesCurrentHistoryItem =
1670 frameLoadType == FrameLoadTypeReplaceCurrentItem; 1677 frameLoadType == FrameLoadTypeReplaceCurrentItem;
1671 policy = client()->decidePolicyForNavigation( 1678 policy = client()->decidePolicyForNavigation(
1672 request, loader, type, policy, replacesCurrentHistoryItem, 1679 request, loader, type, policy, replacesCurrentHistoryItem,
1673 isClientRedirect, form, shouldCheckMainWorldContentSecurityPolicy); 1680 isClientRedirect, form, shouldCheckMainWorldContentSecurityPolicy);
1674 if (policy == NavigationPolicyCurrentTab || 1681 if (policy == NavigationPolicyCurrentTab ||
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 frameLoadRequest.clientRedirect()); 1997 frameLoadRequest.clientRedirect());
1991 1998
1992 loader->setLoadType(loadType); 1999 loader->setLoadType(loadType);
1993 loader->setNavigationType(navigationType); 2000 loader->setNavigationType(navigationType);
1994 loader->setReplacesCurrentHistoryItem(loadType == 2001 loader->setReplacesCurrentHistoryItem(loadType ==
1995 FrameLoadTypeReplaceCurrentItem); 2002 FrameLoadTypeReplaceCurrentItem);
1996 return loader; 2003 return loader;
1997 } 2004 }
1998 2005
1999 } // namespace blink 2006 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-with-redirect-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698