| 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_genericFontFamilySettings(document->frame()->settings()->genericFontFami
lySettings()) | 47 , m_genericFontFamilySettings(document->settings()->genericFontFamilySetting
s()) |
| 48 { | 48 { |
| 49 // 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 |
| 50 // 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 |
| 51 // seem to be any such guarantee. | 51 // seem to be any such guarantee. |
| 52 | 52 |
| 53 ASSERT(m_document); | 53 ASSERT(m_document); |
| 54 ASSERT(m_document->frame()); | |
| 55 FontCache::fontCache()->addClient(this); | 54 FontCache::fontCache()->addClient(this); |
| 56 FontFaceSet::from(*document)->addFontFacesToFontFaceCache(&m_fontFaceCache,
this); | 55 FontFaceSet::from(*document)->addFontFacesToFontFaceCache(&m_fontFaceCache,
this); |
| 57 } | 56 } |
| 58 | 57 |
| 59 CSSFontSelector::~CSSFontSelector() | 58 CSSFontSelector::~CSSFontSelector() |
| 60 { | 59 { |
| 61 } | 60 } |
| 62 | 61 |
| 63 void CSSFontSelector::registerForInvalidationCallbacks(CSSFontSelectorClient* cl
ient) | 62 void CSSFontSelector::registerForInvalidationCallbacks(CSSFontSelectorClient* cl
ient) |
| 64 { | 63 { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 164 |
| 166 DEFINE_TRACE(CSSFontSelector) | 165 DEFINE_TRACE(CSSFontSelector) |
| 167 { | 166 { |
| 168 visitor->trace(m_document); | 167 visitor->trace(m_document); |
| 169 visitor->trace(m_fontFaceCache); | 168 visitor->trace(m_fontFaceCache); |
| 170 visitor->trace(m_clients); | 169 visitor->trace(m_clients); |
| 171 FontSelector::trace(visitor); | 170 FontSelector::trace(visitor); |
| 172 } | 171 } |
| 173 | 172 |
| 174 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |