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

Unified Diff: content/browser/devtools/protocol/network_handler.cc

Issue 1827743002: SameSite: Teach devtools about the new 'samesite' syntax. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-conversion.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/network_handler.cc
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
index 6b7daa6049b36c2e319d275f0730ad61f365feb6..5163f19b853af7839a0038a5ba9404970d2b2a85 100644
--- a/content/browser/devtools/protocol/network_handler.cc
+++ b/content/browser/devtools/protocol/network_handler.cc
@@ -234,7 +234,7 @@ void NetworkHandler::SendGetCookiesResponse(
std::vector<scoped_refptr<Cookie>> cookies;
for (size_t i = 0; i < cookie_list.size(); ++i) {
const net::CanonicalCookie& cookie = cookie_list[i];
- cookies.push_back(Cookie::Create()
+ scoped_refptr<Cookie> devtools_cookie = Cookie::Create()
->set_name(cookie.Name())
->set_value(cookie.Value())
->set_domain(cookie.Domain())
@@ -243,7 +243,19 @@ void NetworkHandler::SendGetCookiesResponse(
->set_size(cookie.Name().length() + cookie.Value().length())
->set_http_only(cookie.IsHttpOnly())
->set_secure(cookie.IsSecure())
- ->set_session(!cookie.IsPersistent()));
+ ->set_session(!cookie.IsPersistent());
+
+ switch (cookie.SameSite()) {
+ case net::CookieSameSite::STRICT_MODE:
+ devtools_cookie->set_same_site(cookie::kSameSiteStrict);
+ break;
+ case net::CookieSameSite::LAX_MODE:
+ devtools_cookie->set_same_site(cookie::kSameSiteLax);
+ break;
+ case net::CookieSameSite::NO_RESTRICTION:
+ break;
+ }
+ cookies.push_back(devtools_cookie);
}
client_->SendGetCookiesResponse(command_id,
GetCookiesResponse::Create()->set_cookies(cookies));
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-conversion.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698