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: third_party/libaddressinput/chromium/chrome_storage_impl.cc

Issue 2968273002: Remove ScopedVector from third_party/libaddressinput/ (Closed)
Patch Set: Created 3 years, 5 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 | « third_party/libaddressinput/chromium/chrome_storage_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « third_party/libaddressinput/chromium/chrome_storage_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698