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

Side by Side Diff: content/browser/devtools/protocol/network_handler.cc

Issue 2633663003: Implements strict secure cookies as the default behavior in //net (Closed)
Patch Set: Rebase on ToT Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/devtools/protocol/network_handler.h" 5 #include "content/browser/devtools/protocol/network_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 const std::string& path, 223 const std::string& path,
224 bool secure, 224 bool secure,
225 bool http_only, 225 bool http_only,
226 net::CookieSameSite same_site, 226 net::CookieSameSite same_site,
227 base::Time expires, 227 base::Time expires,
228 std::unique_ptr<SetCookieCallback> callback) { 228 std::unique_ptr<SetCookieCallback> callback) {
229 DCHECK_CURRENTLY_ON(BrowserThread::IO); 229 DCHECK_CURRENTLY_ON(BrowserThread::IO);
230 net::URLRequestContext* request_context = 230 net::URLRequestContext* request_context =
231 GetRequestContextOnIO(resource_context, context_getter, url); 231 GetRequestContextOnIO(resource_context, context_getter, url);
232 232
233 bool are_experimental_cookie_features_enabled =
234 request_context->network_delegate()
235 ->AreExperimentalCookieFeaturesEnabled();
236
237 request_context->cookie_store()->SetCookieWithDetailsAsync( 233 request_context->cookie_store()->SetCookieWithDetailsAsync(
238 url, name, value, domain, path, 234 url, name, value, domain, path,
239 base::Time(), 235 base::Time(),
240 expires, 236 expires,
241 base::Time(), 237 base::Time(),
242 secure, 238 secure,
243 http_only, 239 http_only,
244 same_site, 240 same_site,
245 are_experimental_cookie_features_enabled,
246 net::COOKIE_PRIORITY_DEFAULT, 241 net::COOKIE_PRIORITY_DEFAULT,
247 base::Bind(&CookieSetOnIO, base::Passed(std::move(callback)))); 242 base::Bind(&CookieSetOnIO, base::Passed(std::move(callback))));
248 } 243 }
249 244
250 std::vector<GURL> ComputeCookieURLs(RenderFrameHostImpl* frame_host, 245 std::vector<GURL> ComputeCookieURLs(RenderFrameHostImpl* frame_host,
251 Maybe<Array<String>>& protocol_urls) { 246 Maybe<Array<String>>& protocol_urls) {
252 std::vector<GURL> urls; 247 std::vector<GURL> urls;
253 248
254 if (protocol_urls.isJust()) { 249 if (protocol_urls.isJust()) {
255 std::unique_ptr<Array<std::string>> actual_urls = protocol_urls.takeJust(); 250 std::unique_ptr<Array<std::string>> actual_urls = protocol_urls.takeJust();
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 static_cast<double>(base::Time::kMicrosecondsPerSecond), 670 static_cast<double>(base::Time::kMicrosecondsPerSecond),
676 completion_status.encoded_data_length); 671 completion_status.encoded_data_length);
677 } 672 }
678 673
679 std::string NetworkHandler::UserAgentOverride() const { 674 std::string NetworkHandler::UserAgentOverride() const {
680 return enabled_ ? user_agent_ : std::string(); 675 return enabled_ ? user_agent_ : std::string();
681 } 676 }
682 677
683 } // namespace protocol 678 } // namespace protocol
684 } // namespace content 679 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698