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

Side by Side Diff: Source/core/css/CSSFontFace.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 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 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 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef CSSFontFace_h 26 #ifndef CSSFontFace_h
27 #define CSSFontFace_h 27 #define CSSFontFace_h
28 28
29 #include "core/css/CSSFontFaceRule.h" 29 #include "core/css/CSSFontFaceRule.h"
30 #include "core/css/CSSFontFaceSource.h" 30 #include "core/css/CSSFontFaceSource.h"
31 #include "core/platform/graphics/FontTraitsMask.h" 31 #include "core/platform/graphics/FontTraitsMask.h"
32 #include "heap/Handle.h"
32 #include <wtf/Forward.h> 33 #include <wtf/Forward.h>
33 #include <wtf/HashSet.h> 34 #include <wtf/HashSet.h>
34 #include <wtf/PassRefPtr.h> 35 #include <wtf/PassRefPtr.h>
35 #include <wtf/RefCounted.h>
36 #include <wtf/unicode/Unicode.h> 36 #include <wtf/unicode/Unicode.h>
37 #include <wtf/Vector.h> 37 #include <wtf/Vector.h>
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class CSSSegmentedFontFace; 41 class CSSSegmentedFontFace;
42 class FontDescription; 42 class FontDescription;
43 class SimpleFontData; 43 class SimpleFontData;
44 44
45 class CSSFontFace : public RefCounted<CSSFontFace> { 45 class CSSFontFace : public HeapAllocatedFinalized<CSSFontFace> {
46 DECLARE_GC_TYPE_MARKER
46 public: 47 public:
47 static PassRefPtr<CSSFontFace> create(FontTraitsMask traitsMask, Handle<CSSF ontFaceRule> rule, bool isLocalFallback = false) { return adoptRef(new CSSFontFa ce(traitsMask, rule, isLocalFallback)); } 48 static Result<CSSFontFace> create(FontTraitsMask traitsMask, Handle<CSSFontF aceRule> rule, bool isLocalFallback = false) { return adopt(new CSSFontFace(trai tsMask, rule, isLocalFallback)); }
48 49
49 FontTraitsMask traitsMask() const { return m_traitsMask; } 50 FontTraitsMask traitsMask() const { return m_traitsMask; }
50 51
51 struct UnicodeRange; 52 struct UnicodeRange;
52 53
53 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); } 54 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); }
54 const Vector<UnicodeRange>& ranges() const { return m_ranges; } 55 const Vector<UnicodeRange>& ranges() const { return m_ranges; }
55 56
56 void addedToSegmentedFontFace(CSSSegmentedFontFace*); 57 void addedToSegmentedFontFace(Handle<CSSSegmentedFontFace>);
57 void removedFromSegmentedFontFace(CSSSegmentedFontFace*); 58 void removedFromSegmentedFontFace(Handle<CSSSegmentedFontFace>);
58 59
59 bool isLoaded() const; 60 bool isLoaded() const;
60 bool isValid() const; 61 bool isValid() const;
61 62
62 bool isLocalFallback() const { return m_isLocalFallback; } 63 bool isLocalFallback() const { return m_isLocalFallback; }
63 64
64 void addSource(PassOwnPtr<CSSFontFaceSource>); 65 void addSource(PassOwnPtr<CSSFontFaceSource>);
65 66
66 void fontLoaded(CSSFontFaceSource*); 67 void fontLoaded(CSSFontFaceSource*);
67 68
(...skipping 14 matching lines...) Expand all
82 UChar32 m_to; 83 UChar32 m_to;
83 }; 84 };
84 85
85 #if ENABLE(SVG_FONTS) 86 #if ENABLE(SVG_FONTS)
86 bool hasSVGFontFaceSource() const; 87 bool hasSVGFontFaceSource() const;
87 #endif 88 #endif
88 89
89 enum LoadState { NotLoaded, Loading, Loaded, Error }; 90 enum LoadState { NotLoaded, Loading, Loaded, Error };
90 LoadState loadState() const { return m_loadState; } 91 LoadState loadState() const { return m_loadState; }
91 92
93 void accept(Visitor*) const;
94
92 private: 95 private:
93 CSSFontFace(FontTraitsMask traitsMask, Handle<CSSFontFaceRule> rule, bool is LocalFallback) 96 CSSFontFace(FontTraitsMask traitsMask, Handle<CSSFontFaceRule> rule, bool is LocalFallback)
94 : m_traitsMask(traitsMask) 97 : m_traitsMask(traitsMask)
95 , m_activeSource(0) 98 , m_activeSource(0)
96 , m_isLocalFallback(isLocalFallback) 99 , m_isLocalFallback(isLocalFallback)
97 , m_loadState(isLocalFallback ? Loaded : NotLoaded) 100 , m_loadState(isLocalFallback ? Loaded : NotLoaded)
98 , m_rule(rule) 101 , m_rule(rule)
99 { 102 {
100 UNUSED_PARAM(rule); 103 UNUSED_PARAM(rule);
101 } 104 }
102 105
103 FontTraitsMask m_traitsMask; 106 FontTraitsMask m_traitsMask;
104 Vector<UnicodeRange> m_ranges; 107 Vector<UnicodeRange> m_ranges;
105 HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces; 108 HashSet<Member<CSSSegmentedFontFace> > m_segmentedFontFaces;
106 Vector<OwnPtr<CSSFontFaceSource> > m_sources; 109 Vector<OwnPtr<CSSFontFaceSource> > m_sources;
107 CSSFontFaceSource* m_activeSource; 110 CSSFontFaceSource* m_activeSource;
108 bool m_isLocalFallback; 111 bool m_isLocalFallback;
109 LoadState m_loadState; 112 LoadState m_loadState;
110 Persistent<CSSFontFaceRule> m_rule; 113 Member<CSSFontFaceRule> m_rule;
111 void notifyFontLoader(LoadState); 114 void notifyFontLoader(LoadState);
112 }; 115 };
113 116
114 } 117 }
115 118
116 #endif 119 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698