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

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

Issue 695553002: Account reconcilor: Use cookie store cookie changed subscription. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 6 years, 1 month 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 | « components/signin/core/browser/account_reconcilor.h ('k') | components/signin/core/browser/signin_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/account_reconcilor.cc
diff --git a/components/signin/core/browser/account_reconcilor.cc b/components/signin/core/browser/account_reconcilor.cc
index 388a5921414d6892e1df13e68501460f6438e6d2..d6cbee892bae297d6749d61469726f5b07bd22e1 100644
--- a/components/signin/core/browser/account_reconcilor.cc
+++ b/components/signin/core/browser/account_reconcilor.cc
@@ -121,6 +121,8 @@ void AccountReconcilor::RegisterForCookieChanges() {
// go off in some embedders on reauth (e.g., ChromeSigninClient).
UnregisterForCookieChanges();
cookie_changed_subscription_ = client_->AddCookieChangedCallback(
+ GaiaUrls::GetInstance()->gaia_url(),
+ "LSID",
base::Bind(&AccountReconcilor::OnCookieChanged, base::Unretained(this)));
}
@@ -160,10 +162,11 @@ bool AccountReconcilor::IsProfileConnected() {
return signin_manager_->IsAuthenticated();
}
-void AccountReconcilor::OnCookieChanged(const net::CanonicalCookie* cookie) {
- if (cookie->Name() == "LSID" &&
- cookie->Domain() == GaiaUrls::GetInstance()->gaia_url().host() &&
- cookie->IsSecure() && cookie->IsHttpOnly()) {
+void AccountReconcilor::OnCookieChanged(const net::CanonicalCookie& cookie,
+ bool removed) {
+ DCHECK_EQ("LSID", cookie.Name());
+ DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url().host(), cookie.Domain());
+ if (cookie.IsSecure() && cookie.IsHttpOnly()) {
VLOG(1) << "AccountReconcilor::OnCookieChanged: LSID changed";
// It is possible that O2RT is not available at this moment.
« no previous file with comments | « components/signin/core/browser/account_reconcilor.h ('k') | components/signin/core/browser/signin_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698