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

Side by Side Diff: net/url_request/url_fetcher_core.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 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_URL_REQUEST_URL_FETCHER_CORE_H_ 5 #ifndef NET_URL_REQUEST_URL_FETCHER_CORE_H_
6 #define NET_URL_REQUEST_URL_FETCHER_CORE_H_ 6 #define NET_URL_REQUEST_URL_FETCHER_CORE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void AppendChunkToUpload(const std::string& data, bool is_last_chunk); 80 void AppendChunkToUpload(const std::string& data, bool is_last_chunk);
81 // |flags| are flags to apply to the load operation--these should be 81 // |flags| are flags to apply to the load operation--these should be
82 // one or more of the LOAD_* flags defined in net/base/load_flags.h. 82 // one or more of the LOAD_* flags defined in net/base/load_flags.h.
83 void SetLoadFlags(int load_flags); 83 void SetLoadFlags(int load_flags);
84 int GetLoadFlags() const; 84 int GetLoadFlags() const;
85 void SetReferrer(const std::string& referrer); 85 void SetReferrer(const std::string& referrer);
86 void SetReferrerPolicy(URLRequest::ReferrerPolicy referrer_policy); 86 void SetReferrerPolicy(URLRequest::ReferrerPolicy referrer_policy);
87 void SetExtraRequestHeaders(const std::string& extra_request_headers); 87 void SetExtraRequestHeaders(const std::string& extra_request_headers);
88 void AddExtraRequestHeader(const std::string& header_line); 88 void AddExtraRequestHeader(const std::string& header_line);
89 void SetRequestContext(URLRequestContextGetter* request_context_getter); 89 void SetRequestContext(URLRequestContextGetter* request_context_getter);
90 // Set the URL that should be consulted for the third-party cookie 90 // Set the URL that should be considered as "initiating" the fetch. This URL
91 // blocking policy. 91 // will be considered the "first-party" when applying cookie blocking policy
92 void SetFirstPartyForCookies(const GURL& first_party_for_cookies); 92 // to requests, and treated as the request's initiator.
93 //
94 // TODO(mkwst): Convert this to a url::Origin. https://crbug.com/577565
95 void SetInitiatorURL(const GURL& initiator);
93 // Set the key and data callback that is used when setting the user 96 // Set the key and data callback that is used when setting the user
94 // data on any URLRequest objects this object creates. 97 // data on any URLRequest objects this object creates.
95 void SetURLRequestUserData( 98 void SetURLRequestUserData(
96 const void* key, 99 const void* key,
97 const URLFetcher::CreateDataCallback& create_data_callback); 100 const URLFetcher::CreateDataCallback& create_data_callback);
98 void SetStopOnRedirect(bool stop_on_redirect); 101 void SetStopOnRedirect(bool stop_on_redirect);
99 void SetAutomaticallyRetryOn5xx(bool retry); 102 void SetAutomaticallyRetryOn5xx(bool retry);
100 void SetMaxRetriesOn5xx(int max_retries); 103 void SetMaxRetriesOn5xx(int max_retries);
101 int GetMaxRetriesOn5xx() const; 104 int GetMaxRetriesOn5xx() const;
102 base::TimeDelta GetBackoffDelay() const; 105 base::TimeDelta GetBackoffDelay() const;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; 239 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
237 // Task runner for upload file access. 240 // Task runner for upload file access.
238 scoped_refptr<base::TaskRunner> upload_file_task_runner_; 241 scoped_refptr<base::TaskRunner> upload_file_task_runner_;
239 scoped_ptr<URLRequest> request_; // The actual request this wraps 242 scoped_ptr<URLRequest> request_; // The actual request this wraps
240 int load_flags_; // Flags for the load operation 243 int load_flags_; // Flags for the load operation
241 int response_code_; // HTTP status code for the request 244 int response_code_; // HTTP status code for the request
242 scoped_refptr<IOBuffer> buffer_; 245 scoped_refptr<IOBuffer> buffer_;
243 // Read buffer 246 // Read buffer
244 scoped_refptr<URLRequestContextGetter> request_context_getter_; 247 scoped_refptr<URLRequestContextGetter> request_context_getter_;
245 // Cookie/cache info for the request 248 // Cookie/cache info for the request
246 GURL first_party_for_cookies_; // The first party URL for the request 249 GURL initiator_; // The request's initiator
247 // The user data to add to each newly-created URLRequest. 250 // The user data to add to each newly-created URLRequest.
248 const void* url_request_data_key_; 251 const void* url_request_data_key_;
249 URLFetcher::CreateDataCallback url_request_create_data_callback_; 252 URLFetcher::CreateDataCallback url_request_create_data_callback_;
250 ResponseCookies cookies_; // Response cookies 253 ResponseCookies cookies_; // Response cookies
251 HttpRequestHeaders extra_request_headers_; 254 HttpRequestHeaders extra_request_headers_;
252 scoped_refptr<HttpResponseHeaders> response_headers_; 255 scoped_refptr<HttpResponseHeaders> response_headers_;
253 bool was_fetched_via_proxy_; 256 bool was_fetched_via_proxy_;
254 bool was_cached_; 257 bool was_cached_;
255 int64_t received_response_content_length_; 258 int64_t received_response_content_length_;
256 int64_t total_received_bytes_; 259 int64_t total_received_bytes_;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 base::debug::StackTrace stack_trace_; 342 base::debug::StackTrace stack_trace_;
340 343
341 static base::LazyInstance<Registry> g_registry; 344 static base::LazyInstance<Registry> g_registry;
342 345
343 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); 346 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore);
344 }; 347 };
345 348
346 } // namespace net 349 } // namespace net
347 350
348 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_ 351 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698