OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef FontFace_h | 31 #ifndef FontFace_h |
32 #define FontFace_h | 32 #define FontFace_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptPromise.h" | 34 #include "bindings/core/v8/ScriptPromise.h" |
| 35 #include "bindings/core/v8/ScriptWrappable.h" |
35 #include "core/CSSPropertyNames.h" | 36 #include "core/CSSPropertyNames.h" |
36 #include "core/css/CSSValue.h" | 37 #include "core/css/CSSValue.h" |
37 #include "core/dom/DOMError.h" | 38 #include "core/dom/DOMError.h" |
38 #include "platform/fonts/FontTraits.h" | 39 #include "platform/fonts/FontTraits.h" |
39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
45 class CSSFontFace; | 46 class CSSFontFace; |
46 class CSSValueList; | 47 class CSSValueList; |
47 class Dictionary; | 48 class Dictionary; |
48 class Document; | 49 class Document; |
49 class ExceptionState; | 50 class ExceptionState; |
50 class FontFaceReadyPromiseResolver; | 51 class FontFaceReadyPromiseResolver; |
51 class StylePropertySet; | 52 class StylePropertySet; |
52 class StyleRuleFontFace; | 53 class StyleRuleFontFace; |
53 | 54 |
54 class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace> { | 55 class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub
lic ScriptWrappable { |
55 public: | 56 public: |
56 enum LoadStatus { Unloaded, Loading, Loaded, Error }; | 57 enum LoadStatus { Unloaded, Loading, Loaded, Error }; |
57 | 58 |
58 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom
icString& family, PassRefPtr<ArrayBuffer> source, const Dictionary&, ExceptionSt
ate&); | 59 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom
icString& family, PassRefPtr<ArrayBuffer> source, const Dictionary&, ExceptionSt
ate&); |
59 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom
icString& family, PassRefPtr<ArrayBufferView>, const Dictionary&, ExceptionState
&); | 60 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom
icString& family, PassRefPtr<ArrayBufferView>, const Dictionary&, ExceptionState
&); |
60 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom
icString& family, const String& source, const Dictionary&, ExceptionState&); | 61 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom
icString& family, const String& source, const Dictionary&, ExceptionState&); |
61 static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFon
tFace*); | 62 static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFon
tFace*); |
62 | 63 |
63 ~FontFace(); | 64 ~FontFace(); |
64 | 65 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; | 131 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; |
131 OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; | 132 OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; |
132 WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback> > m_callbacks; | 133 WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback> > m_callbacks; |
133 }; | 134 }; |
134 | 135 |
135 typedef WillBeHeapVector<RefPtrWillBeMember<FontFace> > FontFaceArray; | 136 typedef WillBeHeapVector<RefPtrWillBeMember<FontFace> > FontFaceArray; |
136 | 137 |
137 } // namespace blink | 138 } // namespace blink |
138 | 139 |
139 #endif // FontFace_h | 140 #endif // FontFace_h |
OLD | NEW |