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

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: Not sure I like this. Created 4 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: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 75eb4220106fe424eb49df9492143b2558913953..d3a28b3a24061376747290a40eb130ad26ae0d57 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -469,6 +469,12 @@ 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_);
+ 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() ||
@@ -565,6 +571,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)),
@@ -913,6 +920,16 @@ void URLRequest::PrepareToRestart() {
proxy_server_ = ProxyServer();
}
+void URLRequest::RewriteURL(const GURL& url, const std::string& reason) {
+ if (net_log_.IsCapturing()) {
+ net_log_.AddEvent(
+ NetLogEventType::URL_REQUEST_REWRITTEN,
+ NetLog::StringCallback("reason", &reason));
+ }
+
+ url_chain_.push_back(url);
+}
+
int URLRequest::Redirect(const RedirectInfo& redirect_info) {
// Matches call in NotifyReceivedRedirect.
OnCallToDelegateComplete();

Powered by Google App Engine
This is Rietveld 408576698