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

Unified Diff: chrome/browser/chromeos/policy/heartbeat_scheduler.cc

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)
Patch Set: Clearer comment in GCMAppHander Created 4 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
Index: chrome/browser/chromeos/policy/heartbeat_scheduler.cc
diff --git a/chrome/browser/chromeos/policy/heartbeat_scheduler.cc b/chrome/browser/chromeos/policy/heartbeat_scheduler.cc
index 6782c70d408e8dd6e693c53d8c05ebc86071abc2..83f79392cce74c13d95dd1ffc539fcdb63414407 100644
--- a/chrome/browser/chromeos/policy/heartbeat_scheduler.cc
+++ b/chrome/browser/chromeos/policy/heartbeat_scheduler.cc
@@ -247,7 +247,6 @@ void HeartbeatScheduler::RefreshHeartbeatSettings() {
// outstanding registration attempts and disconnect from GCM so the
// connection can be shut down. If heartbeats are re-enabled later, we
// will re-register with GCM.
- heartbeat_callback_.Cancel();
ShutdownGCM();
} else {
// Schedule a new upload with the new frequency.
@@ -259,6 +258,7 @@ void HeartbeatScheduler::RefreshHeartbeatSettings() {
}
void HeartbeatScheduler::ShutdownGCM() {
+ heartbeat_callback_.Cancel();
registration_helper_.reset();
registration_id_.clear();
if (registered_app_handler_) {
@@ -424,6 +424,12 @@ void HeartbeatScheduler::ShutdownHandler() {
NOTREACHED() << "HeartbeatScheduler should be destroyed before GCMDriver";
}
+void HeartbeatScheduler::OnStoreReset() {
+ // TODO(crbug.com/661660): Tell server that |registration_id_| is no longer
+ // valid. See also crbug.com/516375.
+ ShutdownGCM();
Andrew T Wilson (Slow) 2016/11/09 08:19:39 Problem is that this will shutdown our GCM connect
johnme 2016/11/09 19:33:48 Makes sense.
+}
+
void HeartbeatScheduler::OnMessage(const std::string& app_id,
const gcm::IncomingMessage& message) {
// Should never be called because we don't get any incoming messages

Powered by Google App Engine
This is Rietveld 408576698