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

Unified Diff: chrome/browser/apps/drive/drive_app_converter.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Address comments from zea@ Created 3 years, 9 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 | « chrome/browser/apps/drive/drive_app_converter.h ('k') | chrome/browser/apps/drive/drive_app_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/drive/drive_app_converter.cc
diff --git a/chrome/browser/apps/drive/drive_app_converter.cc b/chrome/browser/apps/drive/drive_app_converter.cc
index ebe9b9d8664ed2d9060cbcb4962840863a282429..ab25335d44e072fc783d7aecef4a7604fe318208 100644
--- a/chrome/browser/apps/drive/drive_app_converter.cc
+++ b/chrome/browser/apps/drive/drive_app_converter.cc
@@ -12,6 +12,7 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/crx_installer.h"
@@ -153,9 +154,9 @@ void DriveAppConverter::Start() {
pending_sizes.insert(icon_size);
const GURL& icon_url = drive_app_info_.app_icons[i].second;
- IconFetcher* fetcher = new IconFetcher(this, icon_url, icon_size);
- fetchers_.push_back(fetcher); // Pass ownership to |fetchers|.
- fetcher->Start();
+ fetchers_.push_back(
+ base::MakeUnique<IconFetcher>(this, icon_url, icon_size));
+ fetchers_.back()->Start();
}
if (fetchers_.empty())
@@ -182,7 +183,11 @@ void DriveAppConverter::OnIconFetchComplete(const IconFetcher* fetcher) {
web_app_.icons.push_back(icon_info);
}
- fetchers_.erase(std::find(fetchers_.begin(), fetchers_.end(), fetcher));
+ fetchers_.erase(
+ std::find_if(fetchers_.begin(), fetchers_.end(),
+ [fetcher](const std::unique_ptr<IconFetcher>& item) {
+ return item.get() == fetcher;
+ }));
if (fetchers_.empty())
StartInstall();
« no previous file with comments | « chrome/browser/apps/drive/drive_app_converter.h ('k') | chrome/browser/apps/drive/drive_app_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698