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

Side by Side Diff: Source/core/css/CSSFontSelector.h

Issue 18375005: [oilpan] Move CSSFontFace and CSSSegmentedFontFace to the managed heap (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 public: 50 public:
51 static PassRefPtr<CSSFontSelector> create(Document* document) 51 static PassRefPtr<CSSFontSelector> create(Document* document)
52 { 52 {
53 return adoptRef(new CSSFontSelector(document)); 53 return adoptRef(new CSSFontSelector(document));
54 } 54 }
55 virtual ~CSSFontSelector(); 55 virtual ~CSSFontSelector();
56 56
57 virtual unsigned version() const OVERRIDE { return m_version; } 57 virtual unsigned version() const OVERRIDE { return m_version; }
58 58
59 virtual PassRefPtr<FontData> getFontData(const FontDescription&, const Atomi cString&); 59 virtual PassRefPtr<FontData> getFontData(const FontDescription&, const Atomi cString&);
60 CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString & family); 60 Result<CSSSegmentedFontFace> getFontFace(const FontDescription&, const Atomi cString& family);
61 61
62 void clearDocument(); 62 void clearDocument();
63 63
64 void addFontFaceRule(const Handle<StyleRuleFontFace>&); 64 void addFontFaceRule(const Handle<StyleRuleFontFace>&);
65 65
66 void fontLoaded(); 66 void fontLoaded();
67 virtual void fontCacheInvalidated(); 67 virtual void fontCacheInvalidated();
68 68
69 bool isEmpty() const; 69 bool isEmpty() const;
70 70
71 virtual void registerForInvalidationCallbacks(FontSelectorClient*); 71 virtual void registerForInvalidationCallbacks(FontSelectorClient*);
72 virtual void unregisterForInvalidationCallbacks(FontSelectorClient*); 72 virtual void unregisterForInvalidationCallbacks(FontSelectorClient*);
73 73
74 Document* document() const { return m_document; } 74 Document* document() const { return m_document; }
75 75
76 void beginLoadingFontSoon(CachedFont*); 76 void beginLoadingFontSoon(CachedFont*);
77 77
78 private: 78 private:
79 CSSFontSelector(Document*); 79 CSSFontSelector(Document*);
80 80
81 void dispatchInvalidationCallbacks(); 81 void dispatchInvalidationCallbacks();
82 82
83 void beginLoadTimerFired(Timer<CSSFontSelector>*); 83 void beginLoadTimerFired(Timer<CSSFontSelector>*);
84 84
85 Document* m_document; 85 Document* m_document;
86 HashMap<String, OwnPtr<Vector<RefPtr<CSSFontFace> > >, WTF::FastAllocator, C aseFoldingHash> m_fontFaces; 86 typedef CollectionRoot<Vector<Member<CSSFontFace> > > CSSFontFaceVectorColle ction;
87 HashMap<String, OwnPtr<Vector<RefPtr<CSSFontFace> > >, WTF::FastAllocator, C aseFoldingHash> m_locallyInstalledFontFaces; 87 HashMap<String, OwnPtr<CSSFontFaceVectorCollection>, WTF::FastAllocator, Cas eFoldingHash> m_fontFaces;
88 HashMap<String, OwnPtr<HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > >, W TF::FastAllocator, CaseFoldingHash> m_fonts; 88 HashMap<String, OwnPtr<CSSFontFaceVectorCollection>, WTF::FastAllocator, Cas eFoldingHash> m_locallyInstalledFontFaces;
89 // FIXME(oilpan): Implement a weak hashmap on the managed heap.
90 HashMap<String, OwnPtr<HashMap<unsigned, Persistent<CSSSegmentedFontFace> > >, WTF::FastAllocator, CaseFoldingHash> m_fonts;
89 HashSet<FontSelectorClient*> m_clients; 91 HashSet<FontSelectorClient*> m_clients;
90 92
91 Vector<CachedResourceHandle<CachedFont> > m_fontsToBeginLoading; 93 Vector<CachedResourceHandle<CachedFont> > m_fontsToBeginLoading;
92 Timer<CSSFontSelector> m_beginLoadingTimer; 94 Timer<CSSFontSelector> m_beginLoadingTimer;
93 95
94 unsigned m_version; 96 unsigned m_version;
95 }; 97 };
96 98
97 } // namespace WebCore 99 } // namespace WebCore
98 100
99 #endif // CSSFontSelector_h 101 #endif // CSSFontSelector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698