Chromium Code Reviews| Index: third_party/libaddressinput/chromium/chrome_storage_impl.cc |
| diff --git a/third_party/libaddressinput/chromium/chrome_storage_impl.cc b/third_party/libaddressinput/chromium/chrome_storage_impl.cc |
| index 2504eee9af33e2c271eca5466bed7d886d85c2b8..8228805b0bbd09f22c36819e24548ff6cf2ec36d 100644 |
| --- a/third_party/libaddressinput/chromium/chrome_storage_impl.cc |
| +++ b/third_party/libaddressinput/chromium/chrome_storage_impl.cc |
| @@ -39,10 +39,8 @@ void ChromeStorageImpl::Get(const std::string& key, |
| void ChromeStorageImpl::OnPrefValueChanged(const std::string& key) {} |
| void ChromeStorageImpl::OnInitializationCompleted(bool succeeded) { |
| - for (std::vector<Request*>::iterator iter = outstanding_requests_.begin(); |
| - iter != outstanding_requests_.end(); ++iter) { |
| - DoGet((*iter)->key, (*iter)->callback); |
| - } |
| + for (const auto& request : outstanding_requests_) |
| + DoGet(request->key, request->callback); |
| outstanding_requests_.clear(); |
| } |
| @@ -50,7 +48,7 @@ void ChromeStorageImpl::OnInitializationCompleted(bool succeeded) { |
| void ChromeStorageImpl::DoGet(const std::string& key, |
| const Storage::Callback& data_ready) { |
| if (!backing_store_->IsInitializationComplete()) { |
| - outstanding_requests_.push_back(new Request(key, data_ready)); |
| + outstanding_requests_.push_back(base::MakeUnique<Request>(key, data_ready)); |
|
please use gerrit instead
2017/07/07 13:41:18
Would this work?
outstanding_requests_.emplace_ba
Avi (use Gerrit)
2017/07/07 14:56:01
outstanding_requests_ is a vector of unique_ptr, s
|
| return; |
| } |