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

Unified Diff: ios/chrome/browser/favicon/large_icon_cache.cc

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 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
Index: ios/chrome/browser/favicon/large_icon_cache.cc
diff --git a/ios/chrome/browser/favicon/large_icon_cache.cc b/ios/chrome/browser/favicon/large_icon_cache.cc
index b05b79b9946889b7ec3193ca48db48b7a767dcea..a63cb4886217fda30c2daf789453a16a0f6519ed 100644
--- a/ios/chrome/browser/favicon/large_icon_cache.cc
+++ b/ios/chrome/browser/favicon/large_icon_cache.cc
@@ -18,7 +18,7 @@ struct LargeIconCacheEntry {
LargeIconCacheEntry() {}
~LargeIconCacheEntry() {}
- scoped_ptr<favicon_base::LargeIconResult> result;
+ std::unique_ptr<favicon_base::LargeIconResult> result;
};
LargeIconCache::LargeIconCache() : cache_(kMaxCacheSize) {}
@@ -28,12 +28,12 @@ LargeIconCache::~LargeIconCache() {}
void LargeIconCache::SetCachedResult(
const GURL& url,
const favicon_base::LargeIconResult& result) {
- scoped_ptr<LargeIconCacheEntry> entry(new LargeIconCacheEntry);
+ std::unique_ptr<LargeIconCacheEntry> entry(new LargeIconCacheEntry);
entry->result = CloneLargeIconResult(result);
cache_.Put(url, std::move(entry));
}
-scoped_ptr<favicon_base::LargeIconResult> LargeIconCache::GetCachedResult(
+std::unique_ptr<favicon_base::LargeIconResult> LargeIconCache::GetCachedResult(
const GURL& url) {
auto iter = cache_.Get(url);
if (iter != cache_.end()) {
@@ -41,12 +41,13 @@ scoped_ptr<favicon_base::LargeIconResult> LargeIconCache::GetCachedResult(
return CloneLargeIconResult(*iter->second->result.get());
}
- return scoped_ptr<favicon_base::LargeIconResult>();
+ return std::unique_ptr<favicon_base::LargeIconResult>();
}
-scoped_ptr<favicon_base::LargeIconResult> LargeIconCache::CloneLargeIconResult(
+std::unique_ptr<favicon_base::LargeIconResult>
+LargeIconCache::CloneLargeIconResult(
const favicon_base::LargeIconResult& large_icon_result) {
- scoped_ptr<favicon_base::LargeIconResult> clone;
+ std::unique_ptr<favicon_base::LargeIconResult> clone;
if (large_icon_result.bitmap.is_valid()) {
clone.reset(new favicon_base::LargeIconResult(large_icon_result.bitmap));
} else {
« no previous file with comments | « ios/chrome/browser/favicon/large_icon_cache.h ('k') | ios/chrome/browser/favicon/large_icon_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698