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

Unified Diff: net/url_request/url_request.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 years, 1 month 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') | no next file » | 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 61308faafa8d04818411d808fa30329cb73ec569..347335e48ea1f89d155463884fb8b4e99113421d 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -468,8 +468,10 @@ void URLRequest::set_first_party_url_policy(
first_party_url_policy_ = first_party_url_policy;
}
-void URLRequest::set_initiator(const url::Origin& initiator) {
+void URLRequest::set_initiator(const base::Optional<url::Origin>& initiator) {
DCHECK(!is_pending_);
+ DCHECK(!initiator.has_value() || initiator.value().unique() ||
+ initiator.value().GetURL().is_valid());
initiator_ = initiator;
}
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698