OLD | NEW |
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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 LOG(ERROR) << "Failed to destroy GCM store"; | 804 LOG(ERROR) << "Failed to destroy GCM store"; |
805 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED); | 805 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED); |
806 state_ = UNINITIALIZED; | 806 state_ = UNINITIALIZED; |
807 return; | 807 return; |
808 } | 808 } |
809 | 809 |
810 state_ = INITIALIZED; | 810 state_ = INITIALIZED; |
811 } | 811 } |
812 | 812 |
813 void GCMClientImpl::ResetStoreCallback(bool success) { | 813 void GCMClientImpl::ResetStoreCallback(bool success) { |
| 814 delegate_->OnStoreReset(); |
| 815 |
814 if (!success) { | 816 if (!success) { |
815 LOG(ERROR) << "Failed to reset GCM store"; | 817 LOG(ERROR) << "Failed to reset GCM store"; |
816 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED); | 818 RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED); |
817 state_ = UNINITIALIZED; | 819 state_ = UNINITIALIZED; |
818 return; | 820 return; |
819 } | 821 } |
820 | 822 |
821 state_ = INITIALIZED; | 823 state_ = INITIALIZED; |
822 Start(start_mode_); | 824 Start(start_mode_); |
823 } | 825 } |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 bool GCMClientImpl::HasStandaloneRegisteredApp() const { | 1431 bool GCMClientImpl::HasStandaloneRegisteredApp() const { |
1430 if (registrations_.empty()) | 1432 if (registrations_.empty()) |
1431 return false; | 1433 return false; |
1432 // Note that account mapper is not counted as a standalone app since it is | 1434 // Note that account mapper is not counted as a standalone app since it is |
1433 // automatically started when other app uses GCM. | 1435 // automatically started when other app uses GCM. |
1434 return registrations_.size() > 1 || | 1436 return registrations_.size() > 1 || |
1435 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); | 1437 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); |
1436 } | 1438 } |
1437 | 1439 |
1438 } // namespace gcm | 1440 } // namespace gcm |
OLD | NEW |