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

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

Issue 2040133003: Replace SecurityContext::InsecureRequestsPolicy with WebInsecureRequestPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine-uir-block
Patch Set: Ugh. Created 4 years, 6 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include "core/html/FormData.h" 38 #include "core/html/FormData.h"
39 #include "core/html/HTMLFormControlElement.h" 39 #include "core/html/HTMLFormControlElement.h"
40 #include "core/html/HTMLFormElement.h" 40 #include "core/html/HTMLFormElement.h"
41 #include "core/html/HTMLInputElement.h" 41 #include "core/html/HTMLInputElement.h"
42 #include "core/html/parser/HTMLParserIdioms.h" 42 #include "core/html/parser/HTMLParserIdioms.h"
43 #include "core/loader/FrameLoadRequest.h" 43 #include "core/loader/FrameLoadRequest.h"
44 #include "core/loader/FrameLoader.h" 44 #include "core/loader/FrameLoader.h"
45 #include "platform/heap/Handle.h" 45 #include "platform/heap/Handle.h"
46 #include "platform/network/EncodedFormData.h" 46 #include "platform/network/EncodedFormData.h"
47 #include "platform/network/FormDataEncoder.h" 47 #include "platform/network/FormDataEncoder.h"
48 #include "public/platform/WebInsecureRequestPolicy.h"
48 #include "wtf/CurrentTime.h" 49 #include "wtf/CurrentTime.h"
49 #include "wtf/text/StringBuilder.h" 50 #include "wtf/text/StringBuilder.h"
50 #include "wtf/text/TextEncoding.h" 51 #include "wtf/text/TextEncoding.h"
51 52
52 namespace blink { 53 namespace blink {
53 54
54 using namespace HTMLNames; 55 using namespace HTMLNames;
55 56
56 static int64_t generateFormDataIdentifier() 57 static int64_t generateFormDataIdentifier()
57 { 58 {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 192
192 if (copiedAttributes.method() == DialogMethod) { 193 if (copiedAttributes.method() == DialogMethod) {
193 if (submitButton) 194 if (submitButton)
194 return new FormSubmission(submitButton->resultForDialogSubmit()); 195 return new FormSubmission(submitButton->resultForDialogSubmit());
195 return new FormSubmission(""); 196 return new FormSubmission("");
196 } 197 }
197 198
198 Document& document = form->document(); 199 Document& document = form->document();
199 KURL actionURL = document.completeURL(copiedAttributes.action().isEmpty() ? document.url().getString() : copiedAttributes.action()); 200 KURL actionURL = document.completeURL(copiedAttributes.action().isEmpty() ? document.url().getString() : copiedAttributes.action());
200 201
201 if (document.getInsecureRequestsPolicy() == SecurityContext::InsecureRequest sUpgrade && actionURL.protocolIs("http")) { 202 if (document.getInsecureRequestPolicy() & kUpgradeInsecureRequests && action URL.protocolIs("http")) {
202 UseCounter::count(document, UseCounter::UpgradeInsecureRequestsUpgradedR equest); 203 UseCounter::count(document, UseCounter::UpgradeInsecureRequestsUpgradedR equest);
203 actionURL.setProtocol("https"); 204 actionURL.setProtocol("https");
204 if (actionURL.port() == 80) 205 if (actionURL.port() == 80)
205 actionURL.setPort(443); 206 actionURL.setPort(443);
206 } 207 }
207 208
208 bool isMailtoForm = actionURL.protocolIs("mailto"); 209 bool isMailtoForm = actionURL.protocolIs("mailto");
209 bool isMultiPartForm = false; 210 bool isMultiPartForm = false;
210 AtomicString encodingType = copiedAttributes.encodingType(); 211 AtomicString encodingType = copiedAttributes.encodingType();
211 212
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (m_boundary.isEmpty()) 284 if (m_boundary.isEmpty())
284 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 285 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
285 else 286 else
286 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 287 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
287 } 288 }
288 289
289 frameRequest.resourceRequest().setURL(requestURL()); 290 frameRequest.resourceRequest().setURL(requestURL());
290 } 291 }
291 292
292 } // namespace blink 293 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.cpp ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698