Chromium Code Reviews| Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| index d675d5d3ab5d00a6972caca5f0dcdeb1d24ee7a8..555ae30b964c7052366a3be891cb20fe70b170cb 100644 |
| --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| @@ -1632,6 +1632,10 @@ bool FrameLoader::shouldContinueForNavigationPolicy( |
| FrameLoadType frameLoadType, |
| bool isClientRedirect, |
| HTMLFormElement* form) { |
| + Settings* settings = m_frame->settings(); |
| + bool browserSideNavigationEnabled = |
| + settings && settings->getBrowserSideNavigationEnabled(); |
|
alexmos
2017/02/24 06:40:27
nit: could move this after the if statement below,
arthursonzogni
2017/02/24 16:13:29
Done.
|
| + |
| // Don't ask if we are loading an empty URL. |
| if (request.url().isEmpty() || substituteData.isValid()) |
| return true; |
| @@ -1640,7 +1644,12 @@ bool FrameLoader::shouldContinueForNavigationPolicy( |
| // against the parent's Content Security Policy and kill the load if that |
| // check fails, unless we should bypass the main world's CSP. |
| if (policy == NavigationPolicyCurrentTab && |
| - shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy) { |
| + shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy && |
| + // TODO(arthursonzogni): 'frame-src' check is disabled on the |
| + // renderer-side with browser-side-navigation, but is enforced on the |
| + // browser-side. See http://crbug.com/692595 for understanding why it |
| + // can't be enforced on both side instead. |
|
alexmos
2017/02/24 06:40:28
nit: s/side/sides/
arthursonzogni
2017/02/24 16:13:29
Done.
|
| + !browserSideNavigationEnabled) { |
| Frame* parentFrame = m_frame->tree().parent(); |
| if (parentFrame) { |
| ContentSecurityPolicy* parentPolicy = |
| @@ -1666,9 +1675,9 @@ bool FrameLoader::shouldContinueForNavigationPolicy( |
| bool replacesCurrentHistoryItem = |
| frameLoadType == FrameLoadTypeReplaceCurrentItem; |
| - policy = client()->decidePolicyForNavigation(request, loader, type, policy, |
| - replacesCurrentHistoryItem, |
| - isClientRedirect, form); |
| + policy = client()->decidePolicyForNavigation( |
| + request, loader, type, policy, replacesCurrentHistoryItem, |
| + isClientRedirect, form, shouldCheckMainWorldContentSecurityPolicy); |
| if (policy == NavigationPolicyCurrentTab) |
| return true; |
| if (policy == NavigationPolicyIgnore) |