OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |