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

Unified Diff: google_apis/gcm/gcm_client_impl.cc

Issue 183013007: [GCM] Stop/restart GCM when the state is forced off/on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 6 years, 10 months 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
« no previous file with comments | « google_apis/gcm/gcm_client_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/gcm_client_impl.cc
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index 640977afb806f28efd0624d4a181f0d7495b2a5c..aa12ee88a925f8c13bc2976b4edd2c974e996fc3 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -286,14 +286,19 @@ void GCMClientImpl::SetDeviceCredentialsCallback(bool success) {
DCHECK(success);
}
-void GCMClientImpl::CheckOut() {
+void GCMClientImpl::Stop() {
device_checkin_info_.Reset();
mcs_client_.reset();
- gcm_store_->Destroy(base::Bind(&GCMClientImpl::OnGCMStoreDestroyed,
- weak_ptr_factory_.GetWeakPtr()));
checkin_request_.reset();
pending_registrations_.clear();
state_ = INITIALIZED;
+ gcm_store_->Close();
+}
+
+void GCMClientImpl::CheckOut() {
+ Stop();
+ gcm_store_->Destroy(base::Bind(&GCMClientImpl::OnGCMStoreDestroyed,
+ weak_ptr_factory_.GetWeakPtr()));
}
void GCMClientImpl::Register(const std::string& app_id,
« no previous file with comments | « google_apis/gcm/gcm_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698