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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "SVGNames.h" | 56 #include "SVGNames.h" |
57 #endif | 57 #endif |
58 | 58 |
59 using namespace std; | 59 using namespace std; |
60 | 60 |
61 namespace WebCore { | 61 namespace WebCore { |
62 | 62 |
63 CSSFontSelector::CSSFontSelector(Document* document) | 63 CSSFontSelector::CSSFontSelector(Document* document) |
64 : m_document(document) | 64 : m_document(document) |
65 , m_beginLoadingTimer(this, &CSSFontSelector::beginLoadTimerFired) | 65 , m_beginLoadingTimer(this, &CSSFontSelector::beginLoadTimerFired) |
| 66 , m_version(0) |
66 { | 67 { |
67 // FIXME: An old comment used to say there was no need to hold a reference t
o m_document | 68 // FIXME: An old comment used to say there was no need to hold a reference t
o m_document |
68 // because "we are guaranteed to be destroyed before the document". But ther
e does not | 69 // because "we are guaranteed to be destroyed before the document". But ther
e does not |
69 // seem to be any such guarantee. | 70 // seem to be any such guarantee. |
70 | 71 |
71 ASSERT(m_document); | 72 ASSERT(m_document); |
72 fontCache()->addClient(this); | 73 fontCache()->addClient(this); |
73 } | 74 } |
74 | 75 |
75 CSSFontSelector::~CSSFontSelector() | 76 CSSFontSelector::~CSSFontSelector() |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 locallyInstalledFontFace->addSource(adoptPtr(new CSSFontFace
Source(familyName))); | 335 locallyInstalledFontFace->addSource(adoptPtr(new CSSFontFace
Source(familyName))); |
335 ASSERT(locallyInstalledFontFace->isValid()); | 336 ASSERT(locallyInstalledFontFace->isValid()); |
336 familyLocallyInstalledFaces->append(locallyInstalledFontFace
); | 337 familyLocallyInstalledFaces->append(locallyInstalledFontFace
); |
337 } | 338 } |
338 | 339 |
339 m_locallyInstalledFontFaces.set(familyName, familyLocallyInstall
edFaces.release()); | 340 m_locallyInstalledFontFaces.set(familyName, familyLocallyInstall
edFaces.release()); |
340 } | 341 } |
341 } | 342 } |
342 | 343 |
343 familyFontFaces->append(fontFace); | 344 familyFontFaces->append(fontFace); |
| 345 |
| 346 ++m_version; |
344 } | 347 } |
345 } | 348 } |
346 | 349 |
347 void CSSFontSelector::registerForInvalidationCallbacks(FontSelectorClient* clien
t) | 350 void CSSFontSelector::registerForInvalidationCallbacks(FontSelectorClient* clien
t) |
348 { | 351 { |
349 m_clients.add(client); | 352 m_clients.add(client); |
350 } | 353 } |
351 | 354 |
352 void CSSFontSelector::unregisterForInvalidationCallbacks(FontSelectorClient* cli
ent) | 355 void CSSFontSelector::unregisterForInvalidationCallbacks(FontSelectorClient* cli
ent) |
353 { | 356 { |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 for (size_t i = 0; i < fontsToBeginLoading.size(); ++i) { | 616 for (size_t i = 0; i < fontsToBeginLoading.size(); ++i) { |
614 fontsToBeginLoading[i]->beginLoadIfNeeded(cachedResourceLoader); | 617 fontsToBeginLoading[i]->beginLoadIfNeeded(cachedResourceLoader); |
615 // Balances incrementRequestCount() in beginLoadingFontSoon(). | 618 // Balances incrementRequestCount() in beginLoadingFontSoon(). |
616 cachedResourceLoader->decrementRequestCount(fontsToBeginLoading[i].get()
); | 619 cachedResourceLoader->decrementRequestCount(fontsToBeginLoading[i].get()
); |
617 } | 620 } |
618 // Ensure that if the request count reaches zero, the frame loader will know
about it. | 621 // Ensure that if the request count reaches zero, the frame loader will know
about it. |
619 cachedResourceLoader->loadDone(); | 622 cachedResourceLoader->loadDone(); |
620 } | 623 } |
621 | 624 |
622 } | 625 } |
OLD | NEW |