Chromium Code Reviews| 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, |