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

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: Update Cryptauth comment 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
« no previous file with comments | « components/gcm_driver/gcm_account_mapper.h ('k') | components/gcm_driver/gcm_app_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // TODO(crbug.com/661660): Tell server to remove the mapping. But can't use
155 // upstream GCM send for that since the store got reset.
156 ShutdownHandler();
157 }
158
153 void GCMAccountMapper::OnMessage(const std::string& app_id, 159 void GCMAccountMapper::OnMessage(const std::string& app_id,
154 const IncomingMessage& message) { 160 const IncomingMessage& message) {
155 DCHECK_EQ(app_id, kGCMAccountMapperAppId); 161 DCHECK_EQ(app_id, kGCMAccountMapperAppId);
156 // TODO(fgorski): Report Send to Gaia ID failures using UMA. 162 // TODO(fgorski): Report Send to Gaia ID failures using UMA.
157 163
158 if (dispatch_message_callback_.is_null()) { 164 if (dispatch_message_callback_.is_null()) {
159 DVLOG(1) << "dispatch_message_callback_ missing in GCMAccountMapper"; 165 DVLOG(1) << "dispatch_message_callback_ missing in GCMAccountMapper";
160 return; 166 return;
161 } 167 }
162 168
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 390 }
385 391
386 return accounts_.end(); 392 return accounts_.end();
387 } 393 }
388 394
389 void GCMAccountMapper::SetClockForTesting(std::unique_ptr<base::Clock> clock) { 395 void GCMAccountMapper::SetClockForTesting(std::unique_ptr<base::Clock> clock) {
390 clock_ = std::move(clock); 396 clock_ = std::move(clock);
391 } 397 }
392 398
393 } // namespace gcm 399 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_account_mapper.h ('k') | components/gcm_driver/gcm_app_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698