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

Side by Side Diff: components/gcm_driver/gcm_account_mapper.cc

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/gcm_driver/gcm_account_mapper.h" 5 #include "components/gcm_driver/gcm_account_mapper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 } 144 }
145 145
146 void GCMAccountMapper::ShutdownHandler() { 146 void GCMAccountMapper::ShutdownHandler() {
147 initialized_ = false; 147 initialized_ = false;
148 accounts_.clear(); 148 accounts_.clear();
149 registration_id_.clear(); 149 registration_id_.clear();
150 dispatch_message_callback_.Reset(); 150 dispatch_message_callback_.Reset();
151 } 151 }
152 152
153 void GCMAccountMapper::OnStoreReset() {
154 // Nothing to do here since GCMAccountMapper doesn't locally persist
155 // registration ID, instead it just re-registers.
Peter Beverloo 2016/11/03 17:28:56 registration_id_
johnme 2016/11/08 19:22:41 Done (now calls ShutdownHandler).
156 }
157
153 void GCMAccountMapper::OnMessage(const std::string& app_id, 158 void GCMAccountMapper::OnMessage(const std::string& app_id,
154 const IncomingMessage& message) { 159 const IncomingMessage& message) {
155 DCHECK_EQ(app_id, kGCMAccountMapperAppId); 160 DCHECK_EQ(app_id, kGCMAccountMapperAppId);
156 // TODO(fgorski): Report Send to Gaia ID failures using UMA. 161 // TODO(fgorski): Report Send to Gaia ID failures using UMA.
157 162
158 if (dispatch_message_callback_.is_null()) { 163 if (dispatch_message_callback_.is_null()) {
159 DVLOG(1) << "dispatch_message_callback_ missing in GCMAccountMapper"; 164 DVLOG(1) << "dispatch_message_callback_ missing in GCMAccountMapper";
160 return; 165 return;
161 } 166 }
162 167
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 389 }
385 390
386 return accounts_.end(); 391 return accounts_.end();
387 } 392 }
388 393
389 void GCMAccountMapper::SetClockForTesting(std::unique_ptr<base::Clock> clock) { 394 void GCMAccountMapper::SetClockForTesting(std::unique_ptr<base::Clock> clock) {
390 clock_ = std::move(clock); 395 clock_ = std::move(clock);
391 } 396 }
392 397
393 } // namespace gcm 398 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698