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

Unified Diff: net/url_request/url_request.cc

Issue 2053693002: WIP: Move 'Upgrade-Insecure-Requests' to the browser process. Base URL: https://chromium.googlesource.com/chromium/src.git@replicate
Patch Set: Rebase. :( Created 3 years, 10 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 | « net/url_request/url_request.h ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index ec9d001524607a6e4e2b33942da181f7a80fde67..db077452156a75363c6aaacc4d3ef1d25367a934 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -470,6 +470,16 @@ void URLRequest::set_first_party_url_policy(
first_party_url_policy_ = first_party_url_policy;
}
+void URLRequest::set_insecure_request_policy(
+ InsecureRequestPolicy insecure_request_policy) {
+ DCHECK(!is_pending_);
+ DCHECK(insecure_request_policy == DO_NOT_UPGRADE_INSECURE_REQUESTS ||
+ url().SchemeIsCryptographic() ||
+ (insecure_request_policy == UPGRADE_SAME_HOST_INSECURE_REQUESTS &&
+ initiator() && initiator()->host() == url().host()));
+ insecure_request_policy_ = insecure_request_policy;
+}
+
void URLRequest::set_initiator(const base::Optional<url::Origin>& initiator) {
DCHECK(!is_pending_);
DCHECK(!initiator.has_value() || initiator.value().unique() ||
@@ -566,6 +576,7 @@ URLRequest::URLRequest(const GURL& url,
method_("GET"),
referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE),
first_party_url_policy_(NEVER_CHANGE_FIRST_PARTY_URL),
+ insecure_request_policy_(DO_NOT_UPGRADE_INSECURE_REQUESTS),
load_flags_(LOAD_NORMAL),
delegate_(delegate),
status_(URLRequestStatus::FromError(OK)),
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698