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

Unified Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 617003005: Keep the GCM data intact when the user signs out of the profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 | « components/gcm_driver/gcm_driver_desktop.h ('k') | components/gcm_driver/gcm_driver_desktop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver_desktop.cc
diff --git a/components/gcm_driver/gcm_driver_desktop.cc b/components/gcm_driver/gcm_driver_desktop.cc
index 025471824557c40f2bd026349bbeda9ba87ba07d..9714f6fb7c62429a197bb983900be0e2625e021a 100644
--- a/components/gcm_driver/gcm_driver_desktop.cc
+++ b/components/gcm_driver/gcm_driver_desktop.cc
@@ -386,13 +386,18 @@ void GCMDriverDesktop::OnSignedIn() {
EnsureStarted();
}
+void GCMDriverDesktop::OnSignedOut() {
+ signed_in_ = false;
+
+ // When sign-in enforcement is not dropped, we will stop the GCM connection
+ // when the user signs out.
+ if (!GCMDriver::IsAllowedForAllUsers())
+ Stop();
+}
+
void GCMDriverDesktop::Purge() {
DCHECK(ui_thread_->RunsTasksOnCurrentThread());
- // We still proceed with the check-out logic even if the check-in is not
- // initiated in the current session. This will make sure that all the
- // persisted data written previously will get purged.
- signed_in_ = false;
RemoveCachedData();
io_thread_->PostTask(FROM_HERE,
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.h ('k') | components/gcm_driver/gcm_driver_desktop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698