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

Unified Diff: chrome/browser/font_family_cache.h

Issue 2829163004: Remove uses of base::hash_map from //chrome (Closed)
Patch Set: Downloads back Created 3 years, 6 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.h
diff --git a/chrome/browser/font_family_cache.h b/chrome/browser/font_family_cache.h
index 743448d8744aa7d1119728e201fdf33b6ffc327c..2961f3739fb7b623555b056df97a2766a99eff78 100644
--- a/chrome/browser/font_family_cache.h
+++ b/chrome/browser/font_family_cache.h
@@ -5,7 +5,8 @@
#ifndef CHROME_BROWSER_FONT_FAMILY_CACHE_H_
#define CHROME_BROWSER_FONT_FAMILY_CACHE_H_
-#include "base/containers/hash_tables.h"
+#include <unordered_map>
+
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/strings/string16.h"
@@ -23,7 +24,7 @@ FORWARD_DECLARE_TEST(FontFamilyCacheTest, Caching);
// Caches font family preferences associated with a PrefService. This class
// relies on the assumption that each concatenation of map_name + '.' + script
// is a unique string. It also relies on the assumption that the (const char*)
-// keys used in both inner and outer hash_maps are compile time constants.
+// keys used in both inner and outer maps are compile time constants.
class FontFamilyCache : public base::SupportsUserData::Data,
public content::NotificationObserver {
public:
@@ -49,11 +50,11 @@ class FontFamilyCache : public base::SupportsUserData::Data,
// Map from script to font.
// Key comparison uses pointer equality.
- typedef base::hash_map<const char*, base::string16> ScriptFontMap;
+ using ScriptFontMap = std::unordered_map<const char*, base::string16>;
// Map from font family to ScriptFontMap.
// Key comparison uses pointer equality.
- typedef base::hash_map<const char*, ScriptFontMap> FontFamilyMap;
+ using FontFamilyMap = std::unordered_map<const char*, ScriptFontMap>;
// Checks the cache for the font. If not present, fetches the font and stores
// the result in the cache.
@@ -63,7 +64,7 @@ class FontFamilyCache : public base::SupportsUserData::Data,
// of std::string.
// |script| and |map_name| must be compile time constants. Two behaviors rely
// on this: key comparison uses pointer equality, and keys must outlive the
- // hash_maps.
+ // maps.
base::string16 FetchAndCacheFont(const char* script, const char* map_name);
// Called when font family preferences changed.
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc ('k') | chrome/browser/font_family_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698