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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFontSelector.cpp

Issue 1829403002: Clean up font loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Resource_status
Patch Set: Another rebase! Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 26 matching lines...) Expand all
37 #include "core/loader/FrameLoader.h" 37 #include "core/loader/FrameLoader.h"
38 #include "platform/RuntimeEnabledFeatures.h" 38 #include "platform/RuntimeEnabledFeatures.h"
39 #include "platform/fonts/FontCache.h" 39 #include "platform/fonts/FontCache.h"
40 #include "platform/fonts/SimpleFontData.h" 40 #include "platform/fonts/SimpleFontData.h"
41 #include "wtf/text/AtomicString.h" 41 #include "wtf/text/AtomicString.h"
42 42
43 namespace blink { 43 namespace blink {
44 44
45 CSSFontSelector::CSSFontSelector(Document* document) 45 CSSFontSelector::CSSFontSelector(Document* document)
46 : m_document(document) 46 : m_document(document)
47 , m_fontLoader(FontLoader::create(this, document))
48 , m_genericFontFamilySettings(document->frame()->settings()->genericFontFami lySettings()) 47 , m_genericFontFamilySettings(document->frame()->settings()->genericFontFami lySettings())
49 { 48 {
50 // FIXME: An old comment used to say there was no need to hold a reference t o m_document 49 // FIXME: An old comment used to say there was no need to hold a reference t o m_document
51 // because "we are guaranteed to be destroyed before the document". But ther e does not 50 // because "we are guaranteed to be destroyed before the document". But ther e does not
52 // seem to be any such guarantee. 51 // seem to be any such guarantee.
53 52
54 ASSERT(m_document); 53 ASSERT(m_document);
55 ASSERT(m_document->frame()); 54 ASSERT(m_document->frame());
56 FontCache::fontCache()->addClient(this); 55 FontCache::fontCache()->addClient(this);
57 FontFaceSet::from(*document)->addFontFacesToFontFaceCache(&m_fontFaceCache, this); 56 FontFaceSet::from(*document)->addFontFacesToFontFaceCache(&m_fontFaceCache, this);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return; 156 return;
158 m_genericFontFamilySettings = document.settings()->genericFontFamilySettings (); 157 m_genericFontFamilySettings = document.settings()->genericFontFamilySettings ();
159 fontCacheInvalidated(); 158 fontCacheInvalidated();
160 } 159 }
161 160
162 DEFINE_TRACE(CSSFontSelector) 161 DEFINE_TRACE(CSSFontSelector)
163 { 162 {
164 visitor->trace(m_document); 163 visitor->trace(m_document);
165 visitor->trace(m_fontFaceCache); 164 visitor->trace(m_fontFaceCache);
166 visitor->trace(m_clients); 165 visitor->trace(m_clients);
167 visitor->trace(m_fontLoader);
168 FontSelector::trace(visitor); 166 FontSelector::trace(visitor);
169 } 167 }
170 168
171 } // namespace blink 169 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontSelector.h ('k') | third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698