diff options
author | fgorski <fgorski@chromium.org> | 2015-02-26 17:18:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-27 01:19:11 +0000 |
commit | 50b5f9adbfc882750c45eedde5f192e8c930f7f5 (patch) | |
tree | 14425b630f8af9e7853eb9fcd3a34000ac0168cb /google_apis | |
parent | 84043a957612d805925a83c396c52b5da6ca68e1 (diff) | |
download | chromium_src-50b5f9adbfc882750c45eedde5f192e8c930f7f5.zip chromium_src-50b5f9adbfc882750c45eedde5f192e8c930f7f5.tar.gz chromium_src-50b5f9adbfc882750c45eedde5f192e8c930f7f5.tar.bz2 |
[GCM] Fixing the problem of passing linked_ptr across threads
BUG=461936
R=zea@chromium.org
Review URL: https://codereview.chromium.org/958133004
Cr-Commit-Position: refs/heads/master@{#318368}
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/gcm/engine/gcm_store_impl.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/google_apis/gcm/engine/gcm_store_impl.cc b/google_apis/gcm/engine/gcm_store_impl.cc index 07e0c6e..8f701a1 100644 --- a/google_apis/gcm/engine/gcm_store_impl.cc +++ b/google_apis/gcm/engine/gcm_store_impl.cc @@ -159,7 +159,7 @@ class GCMStoreImpl::Backend uint64 device_security_token, const UpdateCallback& callback); void AddRegistration(const std::string& app_id, - const linked_ptr<RegistrationInfo>& registration, + const std::string& serialized_registration, const UpdateCallback& callback); void RemoveRegistration(const std::string& app_id, const UpdateCallback& callback); @@ -369,7 +369,7 @@ void GCMStoreImpl::Backend::SetDeviceCredentials( void GCMStoreImpl::Backend::AddRegistration( const std::string& app_id, - const linked_ptr<RegistrationInfo>& registration, + const std::string& serialized_registration, const UpdateCallback& callback) { DVLOG(1) << "Saving registration info for app: " << app_id; if (!db_.get()) { @@ -381,10 +381,9 @@ void GCMStoreImpl::Backend::AddRegistration( write_options.sync = true; std::string key = MakeRegistrationKey(app_id); - std::string value = registration->SerializeAsString(); const leveldb::Status status = db_->Put(write_options, MakeSlice(key), - MakeSlice(value)); + MakeSlice(serialized_registration)); if (status.ok()) { foreground_task_runner_->PostTask(FROM_HERE, base::Bind(callback, true)); return; @@ -980,12 +979,13 @@ void GCMStoreImpl::AddRegistration( const std::string& app_id, const linked_ptr<RegistrationInfo>& registration, const UpdateCallback& callback) { + std::string serialized_registration = registration->SerializeAsString(); blocking_task_runner_->PostTask( FROM_HERE, base::Bind(&GCMStoreImpl::Backend::AddRegistration, backend_, app_id, - registration, + serialized_registration, callback)); } |