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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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: third_party/WebKit/Source/platform/fonts/FontCache.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
index 54fc72a7f35eaa855e6023b9f8a5dc0027ca27ec..5eddfddc66b58cf86267e23da94bef5adbed27b2 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCache.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
@@ -147,7 +147,7 @@ FontPlatformData* FontCache::getFontPlatformData(
// addResult's scope must end before we recurse for alternate family names
// below, to avoid trigering its dtor hash-changed asserts.
SizedFontPlatformDataSet* sizedFonts =
- &gFontPlatformDataCache->add(key, SizedFontPlatformDataSet())
+ &gFontPlatformDataCache->insert(key, SizedFontPlatformDataSet())
.storedValue->value;
bool wasEmpty = sizedFonts->isEmpty();
@@ -155,7 +155,7 @@ FontPlatformData* FontCache::getFontPlatformData(
// |sizedFont|.
FontPlatformData* anotherSize =
wasEmpty ? nullptr : sizedFonts->begin()->value.get();
- auto addResult = sizedFonts->add(roundedSize, nullptr);
+ auto addResult = sizedFonts->insert(roundedSize, nullptr);
std::unique_ptr<FontPlatformData>* found = &addResult.storedValue->value;
if (addResult.isNewEntry) {
if (wasEmpty)
@@ -184,7 +184,7 @@ FontPlatformData* FontCache::getFontPlatformData(
if (result) {
// Cache the result under the old name.
auto adding =
- &gFontPlatformDataCache->add(key, SizedFontPlatformDataSet())
+ &gFontPlatformDataCache->insert(key, SizedFontPlatformDataSet())
.storedValue->value;
adding->set(roundedSize, WTF::wrapUnique(new FontPlatformData(*result)));
}

Powered by Google App Engine
This is Rietveld 408576698