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

Side by Side Diff: content/browser/loader/async_revalidation_manager.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 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/browser/loader/async_revalidation_manager.h" 5 #include "content/browser/loader/async_revalidation_manager.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 net::HttpRequestHeaders headers; 106 net::HttpRequestHeaders headers;
107 headers.AddHeadersFromString(info->original_headers()); 107 headers.AddHeadersFromString(info->original_headers());
108 108
109 // Construct the request. 109 // Construct the request.
110 scoped_ptr<net::URLRequest> new_request = request_context->CreateRequest( 110 scoped_ptr<net::URLRequest> new_request = request_context->CreateRequest(
111 for_request.url(), net::MINIMUM_PRIORITY, nullptr); 111 for_request.url(), net::MINIMUM_PRIORITY, nullptr);
112 112
113 new_request->set_method(for_request.method()); 113 new_request->set_method(for_request.method());
114 new_request->set_first_party_for_cookies( 114 new_request->set_first_party_for_cookies(
115 for_request.first_party_for_cookies()); 115 for_request.first_party_for_cookies());
116 new_request->set_initiator(for_request.initiator());
116 new_request->set_first_party_url_policy(for_request.first_party_url_policy()); 117 new_request->set_first_party_url_policy(for_request.first_party_url_policy());
117 118
118 new_request->SetReferrer(for_request.referrer()); 119 new_request->SetReferrer(for_request.referrer());
119 new_request->set_referrer_policy(for_request.referrer_policy()); 120 new_request->set_referrer_policy(for_request.referrer_policy());
120 121
121 new_request->SetExtraRequestHeaders(headers); 122 new_request->SetExtraRequestHeaders(headers);
122 123
123 // Remove LOAD_SUPPORT_ASYNC_REVALIDATION and LOAD_MAIN_FRAME flags. 124 // Remove LOAD_SUPPORT_ASYNC_REVALIDATION and LOAD_MAIN_FRAME flags.
124 // Also remove things which shouldn't have been there to begin with, 125 // Also remove things which shouldn't have been there to begin with,
125 // and unrecognised flags. 126 // and unrecognised flags.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 182
182 return true; 183 return true;
183 } 184 }
184 185
185 void AsyncRevalidationManager::OnAsyncRevalidationComplete( 186 void AsyncRevalidationManager::OnAsyncRevalidationComplete(
186 AsyncRevalidationMap::iterator it) { 187 AsyncRevalidationMap::iterator it) {
187 in_progress_.erase(it); 188 in_progress_.erase(it);
188 } 189 }
189 190
190 } // namespace content 191 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698