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

Unified Diff: third_party/WebKit/Source/core/css/FontFaceCache.cpp

Issue 2653773006: Make FontFaceCache::version return unique number across all instances (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceCache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/FontFaceCache.cpp
diff --git a/third_party/WebKit/Source/core/css/FontFaceCache.cpp b/third_party/WebKit/Source/core/css/FontFaceCache.cpp
index d13b86e8ef93156ca4d2b4d4428bb1632837350e..2b7ac476eced570faff87448b9fa8bb17f0ccfcc 100644
--- a/third_party/WebKit/Source/core/css/FontFaceCache.cpp
+++ b/third_party/WebKit/Source/core/css/FontFaceCache.cpp
@@ -40,6 +40,8 @@
namespace blink {
+static unsigned s_version = 0;
+
FontFaceCache::FontFaceCache() : m_version(0) {}
void FontFaceCache::add(CSSFontSelector* cssFontSelector,
@@ -71,7 +73,7 @@ void FontFaceCache::addFontFace(CSSFontSelector* cssFontSelector,
m_cssConnectedFontFaces.add(fontFace);
m_fonts.remove(fontFace->family());
- ++m_version;
+ incrementVersion();
}
void FontFaceCache::remove(const StyleRuleFontFace* fontFaceRule) {
@@ -105,7 +107,7 @@ void FontFaceCache::removeFontFace(FontFace* fontFace, bool cssConnected) {
if (cssConnected)
m_cssConnectedFontFaces.remove(fontFace);
- ++m_version;
+ incrementVersion();
}
void FontFaceCache::clearCSSConnected() {
@@ -122,7 +124,11 @@ void FontFaceCache::clearAll() {
m_fonts.clear();
m_styleRuleToFontFace.clear();
m_cssConnectedFontFaces.clear();
- ++m_version;
+ incrementVersion();
+}
+
+void FontFaceCache::incrementVersion() {
+ m_version = ++s_version;
drott 2017/01/24 12:16:20 I assume multiple documents in the same renderer w
}
CSSSegmentedFontFace* FontFaceCache::get(const FontDescription& fontDescription,
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698