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

Side by Side Diff: components/gcm_driver/gcm_client_impl.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 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_client_impl.h" 5 #include "components/gcm_driver/gcm_client_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 LOG(ERROR) << "Failed to destroy GCM store"; 805 LOG(ERROR) << "Failed to destroy GCM store";
806 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED); 806 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED);
807 state_ = UNINITIALIZED; 807 state_ = UNINITIALIZED;
808 return; 808 return;
809 } 809 }
810 810
811 state_ = INITIALIZED; 811 state_ = INITIALIZED;
812 } 812 }
813 813
814 void GCMClientImpl::ResetStoreCallback(bool success) { 814 void GCMClientImpl::ResetStoreCallback(bool success) {
815 delegate_->OnStoreReset();
jianli 2016/11/08 23:54:57 Do we want to call OnStoreReset if |success| is fa
johnme 2016/11/09 19:33:48 Yes, I think so. Looking at the source code of lev
jianli 2016/11/09 21:54:23 Please add some comments to explain this.
johnme 2016/11/10 19:56:54 Done.
816
815 if (!success) { 817 if (!success) {
816 LOG(ERROR) << "Failed to reset GCM store"; 818 LOG(ERROR) << "Failed to reset GCM store";
817 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED); 819 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED);
818 state_ = UNINITIALIZED; 820 state_ = UNINITIALIZED;
819 return; 821 return;
820 } 822 }
821 823
822 state_ = INITIALIZED; 824 state_ = INITIALIZED;
823 Start(start_mode_); 825 Start(start_mode_);
824 } 826 }
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 bool GCMClientImpl::HasStandaloneRegisteredApp() const { 1435 bool GCMClientImpl::HasStandaloneRegisteredApp() const {
1434 if (registrations_.empty()) 1436 if (registrations_.empty())
1435 return false; 1437 return false;
1436 // Note that account mapper is not counted as a standalone app since it is 1438 // Note that account mapper is not counted as a standalone app since it is
1437 // automatically started when other app uses GCM. 1439 // automatically started when other app uses GCM.
1438 return registrations_.size() > 1 || 1440 return registrations_.size() > 1 ||
1439 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); 1441 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId);
1440 } 1442 }
1441 1443
1442 } // namespace gcm 1444 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698