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

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: Add TODO. 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 initiates the navigation stills occurs in
1669 // blink and is not enforced on the browser-side.
1670 // TODO(arthursonzogni) The 'form-action' check should be fully disabled
1671 // in blink when browser side navigation is enabled, except when the form
1672 // submission doesn't trigger a navigation(i.e. javascript urls). Please
1673 // see https://crbug.com/701749
1674 !browserSideNavigationEnabled &&
1665 !m_frame->document()->contentSecurityPolicy()->allowFormAction( 1675 !m_frame->document()->contentSecurityPolicy()->allowFormAction(
1666 request.url())) 1676 request.url()))
1667 return NavigationPolicyIgnore; 1677 return NavigationPolicyIgnore;
1668 1678
1669 bool replacesCurrentHistoryItem = 1679 bool replacesCurrentHistoryItem =
1670 frameLoadType == FrameLoadTypeReplaceCurrentItem; 1680 frameLoadType == FrameLoadTypeReplaceCurrentItem;
1671 policy = client()->decidePolicyForNavigation( 1681 policy = client()->decidePolicyForNavigation(
1672 request, loader, type, policy, replacesCurrentHistoryItem, 1682 request, loader, type, policy, replacesCurrentHistoryItem,
1673 isClientRedirect, form, shouldCheckMainWorldContentSecurityPolicy); 1683 isClientRedirect, form, shouldCheckMainWorldContentSecurityPolicy);
1674 if (policy == NavigationPolicyCurrentTab || 1684 if (policy == NavigationPolicyCurrentTab ||
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 frameLoadRequest.clientRedirect()); 2000 frameLoadRequest.clientRedirect());
1991 2001
1992 loader->setLoadType(loadType); 2002 loader->setLoadType(loadType);
1993 loader->setNavigationType(navigationType); 2003 loader->setNavigationType(navigationType);
1994 loader->setReplacesCurrentHistoryItem(loadType == 2004 loader->setReplacesCurrentHistoryItem(loadType ==
1995 FrameLoadTypeReplaceCurrentItem); 2005 FrameLoadTypeReplaceCurrentItem);
1996 return loader; 2006 return loader;
1997 } 2007 }
1998 2008
1999 } // namespace blink 2009 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698