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

Unified Diff: net/url_request/url_request.h

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.h
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index f685cf76e7bb23fe2c0f93b28c687cd61cacc71a..6eb7961d25161bd280d93164e6f79451c1c9bf99 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -42,6 +42,10 @@ class StackTrace;
} // namespace debug
} // namespace base
+namespace url {
+class Origin;
+}
+
namespace net {
class ChunkedUploadDataStream;
@@ -282,12 +286,20 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
}
void set_first_party_url_policy(FirstPartyURLPolicy first_party_url_policy);
+ // The origin of the context which initiated the request.
+ const url::Origin initiator() const { return initiator_; }
mmenke 2015/10/21 15:36:38 const url::Origin&
mmenke 2015/10/21 15:36:38 I'm concerned that I have no idea what the differe
Mike West 2015/10/22 13:17:02 Done and done.
+ // This method may only be called before Start().
+ void set_initiator(const url::Origin& initiator);
+
// The request method, as an uppercase string. "GET" is the default value.
// The request method may only be changed before Start() is called and
// should only be assigned an uppercase value.
const std::string& method() const { return method_; }
void set_method(const std::string& method);
+ // True if the request method is "safe" (per section 4.2.1 of RFC 7231).
+ bool is_safe_method() const;
+
// The referrer URL for the request. This header may actually be suppressed
// from the underlying network request for security reasons (e.g., a HTTPS
// URL will not be sent as the referrer for a HTTP request). The referrer
@@ -759,6 +771,7 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
std::vector<GURL> url_chain_;
GURL first_party_for_cookies_;
+ url::Origin initiator_;
GURL delegate_redirect_url_;
std::string method_; // "GET", "POST", etc. Should be all uppercase.
std::string referrer_;

Powered by Google App Engine
This is Rietveld 408576698