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

Unified Diff: chrome/browser/font_family_cache.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase Created 3 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: chrome/browser/font_family_cache.cc
diff --git a/chrome/browser/font_family_cache.cc b/chrome/browser/font_family_cache.cc
index 45d6a9affdefe337c41453622f9195ed48714e15..bf2359042baea3e7dc433d6ca66643cb9a89e1ab 100644
--- a/chrome/browser/font_family_cache.cc
+++ b/chrome/browser/font_family_cache.cc
@@ -8,6 +8,7 @@
#include <map>
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -38,8 +39,7 @@ void FontFamilyCache::FillFontFamilyMap(Profile* profile,
static_cast<FontFamilyCache*>(profile->GetUserData(&kFontFamilyCacheKey));
if (!cache) {
cache = new FontFamilyCache(profile);
- // The profile takes ownership of |cache|.
- profile->SetUserData(&kFontFamilyCacheKey, cache);
+ profile->SetUserData(&kFontFamilyCacheKey, base::WrapUnique(cache));
}
cache->FillFontFamilyMap(map_name, map);
« no previous file with comments | « chrome/browser/data_use_measurement/data_use_web_contents_observer.cc ('k') | chrome/browser/infobars/infobar_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698