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

Side by Side Diff: google_apis/gcm/engine/gcm_store_impl.h

Issue 147193003: [GCM] Fix memory leaks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « google_apis/gcm/engine/gcm_store.h ('k') | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_
6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 int64 serial_number, 67 int64 serial_number,
68 const UpdateCallback& callback) OVERRIDE; 68 const UpdateCallback& callback) OVERRIDE;
69 virtual void RemoveUserSerialNumber(const std::string& username, 69 virtual void RemoveUserSerialNumber(const std::string& username,
70 const UpdateCallback& callback) OVERRIDE; 70 const UpdateCallback& callback) OVERRIDE;
71 71
72 private: 72 private:
73 typedef std::map<std::string, int> AppIdToMessageCountMap; 73 typedef std::map<std::string, int> AppIdToMessageCountMap;
74 74
75 // Continuation to update the per-app message counts after a load. 75 // Continuation to update the per-app message counts after a load.
76 void LoadContinuation(const LoadCallback& callback, 76 void LoadContinuation(const LoadCallback& callback,
77 const LoadResult& result); 77 scoped_ptr<LoadResult> result);
78 78
79 // Continuation to update the per-app message counts when adding messages. 79 // Continuation to update the per-app message counts when adding messages.
80 // In particular, if a message fails to add, the message count is decremented. 80 // In particular, if a message fails to add, the message count is decremented.
81 void AddOutgoingMessageContinuation(const UpdateCallback& callback, 81 void AddOutgoingMessageContinuation(const UpdateCallback& callback,
82 const std::string& app_id, 82 const std::string& app_id,
83 bool success); 83 bool success);
84 84
85 // Continuation to update the per-app message counts when removing messages. 85 // Continuation to update the per-app message counts when removing messages.
86 // Note: if doing a read-then-write when removing messages proves expensive, 86 // Note: if doing a read-then-write when removing messages proves expensive,
87 // an in-memory mapping of persisted message id to app could be maintained 87 // an in-memory mapping of persisted message id to app could be maintained
(...skipping 12 matching lines...) Expand all
100 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 100 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
101 101
102 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_; 102 base::WeakPtrFactory<GCMStoreImpl> weak_ptr_factory_;
103 103
104 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl); 104 DISALLOW_COPY_AND_ASSIGN(GCMStoreImpl);
105 }; 105 };
106 106
107 } // namespace gcm 107 } // namespace gcm
108 108
109 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_ 109 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_IMPL_H_
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/gcm_store.h ('k') | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698