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

Unified Diff: google_apis/gcm/gcm_client_impl.cc

Issue 147193003: [GCM] Fix memory leaks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows Created 6 years, 11 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') | google_apis/gcm/tools/mcs_probe.cc » ('j') | 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 e03211f98e1872258d9c06989782e17a8d37766a..6ab61afb8e6c364cdf435d25fbece331c8577864 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -61,19 +61,19 @@ void GCMClientImpl::Initialize(
state_ = LOADING;
}
-void GCMClientImpl::OnLoadCompleted(const GCMStore::LoadResult& result) {
+void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) {
DCHECK_EQ(LOADING, state_);
- if (!result.success) {
+ if (!result->success) {
ResetState();
return;
}
- user_list_->Initialize(result.serial_number_mappings);
+ user_list_->Initialize(result->serial_number_mappings);
- device_checkin_info_.android_id = result.device_android_id;
- device_checkin_info_.secret = result.device_security_token;
- InitializeMCSClient(result);
+ device_checkin_info_.android_id = result->device_android_id;
+ device_checkin_info_.secret = result->device_security_token;
+ InitializeMCSClient(result.Pass());
if (!device_checkin_info_.IsValid()) {
device_checkin_info_.Reset();
state_ = INITIAL_DEVICE_CHECKIN;
@@ -84,13 +84,14 @@ void GCMClientImpl::OnLoadCompleted(const GCMStore::LoadResult& result) {
}
}
-void GCMClientImpl::InitializeMCSClient(const GCMStore::LoadResult& result) {
+void GCMClientImpl::InitializeMCSClient(
+ scoped_ptr<GCMStore::LoadResult> result) {
mcs_client_->Initialize(
base::Bind(&GCMClientImpl::OnMCSError, base::Unretained(this)),
base::Bind(&GCMClientImpl::OnMessageReceivedFromMCS,
base::Unretained(this)),
base::Bind(&GCMClientImpl::OnMessageSentToMCS, base::Unretained(this)),
- result);
+ result.Pass());
}
void GCMClientImpl::OnFirstTimeDeviceCheckinCompleted(
« no previous file with comments | « google_apis/gcm/gcm_client_impl.h ('k') | google_apis/gcm/tools/mcs_probe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698