Add comments to FontFamilyCache.
The purpose was unclear, since it looks like a cache for speeding up reading,
whereas the cache is intended to speed up writing updates to
content::ScriptFontFamilyMap.
Bug: 308095
Change-Id: Ib436fbde83b97fec1b2193f47f29064a66be6e26
TBR: [email protected]
Reviewed-on: https://chromium-review.googlesource.com/642369
Reviewed-by: Erik Chen <[email protected]>
Commit-Queue: Erik Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#498287}
diff --git a/chrome/browser/font_family_cache.h b/chrome/browser/font_family_cache.h
index 2961f37..9366134 100644
--- a/chrome/browser/font_family_cache.h
+++ b/chrome/browser/font_family_cache.h
@@ -25,6 +25,10 @@
// 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 maps are compile time constants.
+// This class caches the strings necessary to update
+// "content::ScriptFontFamilyMap". This is necessary since Chrome attempts to
+// update content::ScriptFontFamilyMap 20000 times at startup. See
+// https://crbug.com/308095.
class FontFamilyCache : public base::SupportsUserData::Data,
public content::NotificationObserver {
public: