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

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 790383002: Remove NavigationAction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index 55c01f5891c32b7cebd6b5c81180d389f989181c..175d69fbb09915f6e5cbc344689dbe62cfea3275 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -83,6 +83,7 @@ DocumentLoader::DocumentLoader(LocalFrame* frame, const ResourceRequest& req, co
, m_committed(false)
, m_isClientRedirect(false)
, m_replacesCurrentHistoryItem(false)
+ , m_navigationType(NavigationTypeOther)
, m_loadingMainResource(false)
, m_timeOfLastDataReceived(0.0)
, m_applicationCacheHost(ApplicationCacheHost::create(this))
@@ -301,7 +302,7 @@ bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons
return false;
}
-bool DocumentLoader::shouldContinueForNavigationPolicy(const ResourceRequest& request, ContentSecurityPolicyDisposition shouldCheckMainWorldContentSecurityPolicy, bool isTransitionNavigation)
+bool DocumentLoader::shouldContinueForNavigationPolicy(const ResourceRequest& request, ContentSecurityPolicyDisposition shouldCheckMainWorldContentSecurityPolicy, NavigationPolicy policy, bool isTransitionNavigation)
{
// Don't ask if we are loading an empty URL.
if (request.url().isEmpty() || m_substituteData.isValid())
@@ -319,7 +320,6 @@ bool DocumentLoader::shouldContinueForNavigationPolicy(const ResourceRequest& re
return false;
}
- NavigationPolicy policy = m_triggeringAction.policy();
policy = frameLoader()->client()->decidePolicyForNavigation(request, this, policy, isTransitionNavigation);
if (policy == NavigationPolicyCurrentTab)
return true;
@@ -355,7 +355,7 @@ void DocumentLoader::willSendRequest(ResourceRequest& newRequest, const Resource
// deferrals plays less of a part in this function in preventing the bad behavior deferring
// callbacks is meant to prevent.
ASSERT(!newRequest.isNull());
- if (isFormSubmission(m_triggeringAction.type()) && !m_frame->document()->contentSecurityPolicy()->allowFormAction(newRequest.url())) {
+ if (isFormSubmission(m_navigationType) && !m_frame->document()->contentSecurityPolicy()->allowFormAction(newRequest.url())) {
cancelMainResourceLoad(ResourceError::cancelledError(newRequest.url()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698