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

Unified Diff: Source/core/html/HTMLFormElement.cpp

Issue 638253002: Revert "Mixed Content: Use a static method to check form actions." (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormElement.cpp
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index bac61dd511fee56ad6ac132edbb767ee7b0d9ac3..ae110acc3f4f2d73c57fcce4d1083d39e5bf86f5 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -442,12 +442,12 @@ void HTMLFormElement::scheduleFormSubmission(PassRefPtrWillBeRawPtr<FormSubmissi
if (!targetFrame->page())
return;
- UseCounter::count(document(), UseCounter::FormsSubmitted);
- if (MixedContentChecker::checkFormAction(document().frame(), submission->action())) {
- // FIXME: Once we have a better feel for what the numbers are here, we can decide
- // whether we want to do more than degrade the UI (which is a side-effect of
- // checkFormAction.
+ if (MixedContentChecker::isMixedContent(document().securityOrigin(), submission->action())) {
UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted);
+ if (!document().frame()->loader().mixedContentChecker()->canSubmitToInsecureForm(document().securityOrigin(), submission->action()))
+ return;
+ } else {
+ UseCounter::count(document(), UseCounter::FormsSubmitted);
}
targetFrame->navigationScheduler().scheduleFormSubmission(submission);
@@ -519,7 +519,8 @@ void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri
// If the new action attribute is pointing to insecure "action" location from a secure page
// it is marked as "passive" mixed content.
KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action());
- MixedContentChecker::checkFormAction(document().frame(), actionURL);
+ if (document().frame() && MixedContentChecker::isMixedContent(document().securityOrigin(), actionURL))
+ document().frame()->loader().mixedContentChecker()->canSubmitToInsecureForm(document().securityOrigin(), actionURL);
} else if (name == targetAttr)
m_attributes.setTarget(value);
else if (name == methodAttr)
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698