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

Unified Diff: google_apis/gcm/engine/gcm_store_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/engine/gcm_store_impl.h ('k') | google_apis/gcm/engine/gcm_store_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/gcm_store_impl.cc
diff --git a/google_apis/gcm/engine/gcm_store_impl.cc b/google_apis/gcm/engine/gcm_store_impl.cc
index 31b258f7a6c149281bbe379ef4e2f49ee82e4cae..91d3e70077bdaf1a68d03f064a65626bd7ffb84e 100644
--- a/google_apis/gcm/engine/gcm_store_impl.cc
+++ b/google_apis/gcm/engine/gcm_store_impl.cc
@@ -96,6 +96,7 @@ class GCMStoreImpl::Backend
// Blocking implementations of GCMStoreImpl methods.
void Load(const LoadCallback& callback);
+ void Close();
void Destroy(const UpdateCallback& callback);
void SetDeviceCredentials(uint64 device_android_id,
uint64 device_security_token,
@@ -213,6 +214,11 @@ void GCMStoreImpl::Backend::Load(const LoadCallback& callback) {
return;
}
+void GCMStoreImpl::Backend::Close() {
+ DVLOG(1) << "Closing GCM store.";
+ db_.reset();
+}
+
void GCMStoreImpl::Backend::Destroy(const UpdateCallback& callback) {
DVLOG(1) << "Destroying GCM store.";
db_.reset();
@@ -634,6 +640,12 @@ void GCMStoreImpl::Load(const LoadCallback& callback) {
callback)));
}
+void GCMStoreImpl::Close() {
+ blocking_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&GCMStoreImpl::Backend::Close, backend_));
+}
+
void GCMStoreImpl::Destroy(const UpdateCallback& callback) {
blocking_task_runner_->PostTask(
FROM_HERE,
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl.h ('k') | google_apis/gcm/engine/gcm_store_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698