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

Unified Diff: net/url_request/url_request.cc

Issue 1411813003: Teach URLRequest about initiator checks for First-Party-Only cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 5 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
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index ad399b9ea081c51ed85b81c790be9b1215964550..8d40426426095cc03a32ae4fe21bafc5d50d22bb 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -463,11 +463,21 @@ void URLRequest::set_first_party_url_policy(
first_party_url_policy_ = first_party_url_policy;
}
+void URLRequest::set_initiator(const url::Origin& initiator) {
+ DCHECK(!is_pending_);
+ initiator_ = initiator;
+}
+
void URLRequest::set_method(const std::string& method) {
DCHECK(!is_pending_);
method_ = method;
}
+bool URLRequest::is_safe_method() const {
mmenke 2015/10/21 15:36:38 This isn't an accessor, nor is it a "very short in
mmenke 2015/10/21 15:36:38 Maybe IsMethodSafe, to make it clearer this is an
Mike West 2015/10/22 13:17:02 Done.
+ return method_ == "GET" || method_ == "HEAD" || method_ == "OPTIONS" ||
+ method_ == "TRACE";
+}
+
void URLRequest::SetReferrer(const std::string& referrer) {
DCHECK(!is_pending_);
GURL referrer_url(referrer);

Powered by Google App Engine
This is Rietveld 408576698