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

Unified Diff: google_apis/gcm/engine/gcm_store.h

Issue 1183843002: Do not create GCM store if it is not needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybots Created 5 years, 6 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
Index: google_apis/gcm/engine/gcm_store.h
diff --git a/google_apis/gcm/engine/gcm_store.h b/google_apis/gcm/engine/gcm_store.h
index 83ec73de0ec14f30d6d824557041788faa4364a1..e3dd58fbc819a06e16b93b994d91c8b46fba588a 100644
--- a/google_apis/gcm/engine/gcm_store.h
+++ b/google_apis/gcm/engine/gcm_store.h
@@ -29,6 +29,11 @@ class MCSMessage;
// as well as store device and user checkin information.
class GCM_EXPORT GCMStore {
public:
+ enum StoreOpenMode {
+ DO_NOT_CREATE_NEW_STORE,
+ CREATE_NEW_STORE_IF_NOT_EXISTS
Nicolas Zea 2015/06/15 17:58:37 nit: CREATE_IF_MISSING (which is the variable you
jianli 2015/06/15 20:50:23 Done.
+ };
+
// Map of message id to message data for outgoing messages.
typedef std::map<std::string, linked_ptr<google::protobuf::MessageLite> >
OutgoingMessageMap;
@@ -44,6 +49,7 @@ class GCM_EXPORT GCMStore {
void Reset();
bool success;
+ bool store_does_not_exist;
uint64 device_android_id;
uint64 device_security_token;
std::map<std::string, std::string> registrations;
@@ -68,7 +74,7 @@ class GCM_EXPORT GCMStore {
// Load the data from persistent store and pass the initial state back to
// caller.
- virtual void Load(const LoadCallback& callback) = 0;
+ virtual void Load(StoreOpenMode open_mode, const LoadCallback& callback) = 0;
// Close the persistent store.
virtual void Close() = 0;

Powered by Google App Engine
This is Rietveld 408576698