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

Unified Diff: components/signin/core/browser/gaia_cookie_manager_service.cc

Issue 2113863002: components/signin: convert GaiaCookieManagerService to use CanonicalCookie's Create() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ListAccountsAfterOnCookieChanged? Created 4 years, 5 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 | google_apis/gaia/gaia_urls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/gaia_cookie_manager_service.cc
diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc
index d6b4f01106f052b631d650625200d1f1bbe58e1b..aa13efe2c630150b83baec3a4b15bca081fcd729 100644
--- a/components/signin/core/browser/gaia_cookie_manager_service.cc
+++ b/components/signin/core/browser/gaia_cookie_manager_service.cc
@@ -378,11 +378,11 @@ void GaiaCookieManagerService::TriggerListAccounts() {
void GaiaCookieManagerService::ForceOnCookieChangedProcessing() {
GURL google_url = GaiaUrls::GetInstance()->google_url();
- net::CanonicalCookie cookie(
- google_url, kGaiaCookieName, "", google_url.host(), "", base::Time(),
- base::Time(), base::Time(), false, false,
- net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT);
- OnCookieChanged(cookie, true);
+ std::unique_ptr<net::CanonicalCookie> cookie(net::CanonicalCookie::Create(
+ google_url, kGaiaCookieName, std::string(), "." + google_url.host(),
+ std::string(), base::Time(), base::Time(), false, false,
+ net::CookieSameSite::DEFAULT_MODE, false, net::COOKIE_PRIORITY_DEFAULT));
+ OnCookieChanged(*cookie, true);
}
void GaiaCookieManagerService::LogOutAllAccounts() {
@@ -454,7 +454,7 @@ void GaiaCookieManagerService::OnCookieChanged(
const net::CanonicalCookie& cookie,
bool removed) {
DCHECK_EQ(kGaiaCookieName, cookie.Name());
- DCHECK_EQ(GaiaUrls::GetInstance()->google_url().host(), cookie.Domain());
+ DCHECK(cookie.IsDomainMatch(GaiaUrls::GetInstance()->google_url().host()));
list_accounts_stale_ = true;
// Ignore changes to the cookie while requests are pending. These changes
// are caused by the service itself as it adds accounts. A side effects is
« no previous file with comments | « no previous file | google_apis/gaia/gaia_urls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698