| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CanvasFontCache_h | 5 #ifndef CanvasFontCache_h |
| 6 #define CanvasFontCache_h | 6 #define CanvasFontCache_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/StylePropertySet.h" | 9 #include "core/css/StylePropertySet.h" |
| 10 #include "platform/fonts/Font.h" | 10 #include "platform/fonts/Font.h" |
| 11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 12 #include "public/platform/WebThread.h" | 12 #include "public/platform/WebThread.h" |
| 13 #include "wtf/HashMap.h" | 13 #include "wtf/HashMap.h" |
| 14 #include "wtf/ListHashSet.h" | 14 #include "wtf/ListHashSet.h" |
| 15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
| 16 #include <memory> |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class Document; | 20 class Document; |
| 20 class FontCachePurgePreventer; | 21 class FontCachePurgePreventer; |
| 21 | 22 |
| 22 class CORE_EXPORT CanvasFontCache final : public GarbageCollectedFinalized<Canva
sFontCache>, public WebThread::TaskObserver { | 23 class CORE_EXPORT CanvasFontCache final : public GarbageCollectedFinalized<Canva
sFontCache>, public WebThread::TaskObserver { |
| 23 public: | 24 public: |
| 24 static CanvasFontCache* create(Document& document) | 25 static CanvasFontCache* create(Document& document) |
| 25 { | 26 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 48 ~CanvasFontCache(); | 49 ~CanvasFontCache(); |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 explicit CanvasFontCache(Document&); | 52 explicit CanvasFontCache(Document&); |
| 52 void schedulePruningIfNeeded(); | 53 void schedulePruningIfNeeded(); |
| 53 typedef HeapHashMap<String, Member<MutableStylePropertySet>> MutableStylePro
pertyMap; | 54 typedef HeapHashMap<String, Member<MutableStylePropertySet>> MutableStylePro
pertyMap; |
| 54 | 55 |
| 55 HashMap<String, Font> m_fontsResolvedUsingDefaultStyle; | 56 HashMap<String, Font> m_fontsResolvedUsingDefaultStyle; |
| 56 MutableStylePropertyMap m_fetchedFonts; | 57 MutableStylePropertyMap m_fetchedFonts; |
| 57 ListHashSet<String> m_fontLRUList; | 58 ListHashSet<String> m_fontLRUList; |
| 58 OwnPtr<FontCachePurgePreventer> m_mainCachePurgePreventer; | 59 std::unique_ptr<FontCachePurgePreventer> m_mainCachePurgePreventer; |
| 59 Member<Document> m_document; | 60 Member<Document> m_document; |
| 60 RefPtr<ComputedStyle> m_defaultFontStyle; | 61 RefPtr<ComputedStyle> m_defaultFontStyle; |
| 61 bool m_pruningScheduled; | 62 bool m_pruningScheduled; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace blink | 65 } // namespace blink |
| 65 | 66 |
| 66 #endif | 67 #endif |
| OLD | NEW |