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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "bindings/core/v8/ActiveScriptWrappable.h" | 34 #include "bindings/core/v8/ActiveScriptWrappable.h" |
35 #include "bindings/core/v8/ScriptPromise.h" | 35 #include "bindings/core/v8/ScriptPromise.h" |
36 #include "bindings/core/v8/ScriptPromiseProperty.h" | 36 #include "bindings/core/v8/ScriptPromiseProperty.h" |
37 #include "bindings/core/v8/ScriptWrappable.h" | 37 #include "bindings/core/v8/ScriptWrappable.h" |
38 #include "core/CSSPropertyNames.h" | 38 #include "core/CSSPropertyNames.h" |
39 #include "core/css/CSSValue.h" | 39 #include "core/css/CSSValue.h" |
40 #include "core/dom/ActiveDOMObject.h" | 40 #include "core/dom/ActiveDOMObject.h" |
41 #include "core/dom/DOMException.h" | 41 #include "core/dom/DOMException.h" |
42 #include "platform/fonts/FontTraits.h" | 42 #include "platform/fonts/FontTraits.h" |
| 43 #include "wtf/PassRefPtr.h" |
| 44 #include "wtf/RefCounted.h" |
43 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
44 | 46 |
45 namespace blink { | 47 namespace blink { |
46 | 48 |
47 class CSSFontFace; | 49 class CSSFontFace; |
48 class CSSValue; | 50 class CSSValue; |
49 class DOMArrayBuffer; | 51 class DOMArrayBuffer; |
50 class DOMArrayBufferView; | 52 class DOMArrayBufferView; |
51 class Document; | 53 class Document; |
52 class ExceptionState; | 54 class ExceptionState; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 virtual void notifyLoaded(FontFace*) = 0; | 107 virtual void notifyLoaded(FontFace*) = 0; |
106 virtual void notifyError(FontFace*) = 0; | 108 virtual void notifyError(FontFace*) = 0; |
107 DEFINE_INLINE_VIRTUAL_TRACE() { } | 109 DEFINE_INLINE_VIRTUAL_TRACE() { } |
108 }; | 110 }; |
109 void loadWithCallback(LoadFontCallback*, ExecutionContext*); | 111 void loadWithCallback(LoadFontCallback*, ExecutionContext*); |
110 | 112 |
111 // ActiveScriptWrappable. | 113 // ActiveScriptWrappable. |
112 bool hasPendingActivity() const final; | 114 bool hasPendingActivity() const final; |
113 | 115 |
114 private: | 116 private: |
115 static FontFace* create(ExecutionContext*, const AtomicString& family, DOMAr
rayBuffer* source, const FontFaceDescriptors&); | 117 static FontFace* create(ExecutionContext*, const AtomicString& family, PassR
efPtr<DOMArrayBuffer> source, const FontFaceDescriptors&); |
116 static FontFace* create(ExecutionContext*, const AtomicString& family, DOMAr
rayBufferView*, const FontFaceDescriptors&); | 118 static FontFace* create(ExecutionContext*, const AtomicString& family, PassR
efPtr<DOMArrayBufferView>, const FontFaceDescriptors&); |
117 static FontFace* create(ExecutionContext*, const AtomicString& family, const
String& source, const FontFaceDescriptors&); | 119 static FontFace* create(ExecutionContext*, const AtomicString& family, const
String& source, const FontFaceDescriptors&); |
118 | 120 |
119 explicit FontFace(ExecutionContext*); | 121 explicit FontFace(ExecutionContext*); |
120 FontFace(ExecutionContext*, const AtomicString& family, const FontFaceDescri
ptors&); | 122 FontFace(ExecutionContext*, const AtomicString& family, const FontFaceDescri
ptors&); |
121 | 123 |
122 void initCSSFontFace(Document*, CSSValue* src); | 124 void initCSSFontFace(Document*, CSSValue* src); |
123 void initCSSFontFace(const unsigned char* data, size_t); | 125 void initCSSFontFace(const unsigned char* data, size_t); |
124 void setPropertyFromString(const Document*, const String&, CSSPropertyID, Ex
ceptionState* = 0); | 126 void setPropertyFromString(const Document*, const String&, CSSPropertyID, Ex
ceptionState* = 0); |
125 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); | 127 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); |
126 bool setPropertyValue(CSSValue*, CSSPropertyID); | 128 bool setPropertyValue(CSSValue*, CSSPropertyID); |
(...skipping 18 matching lines...) Expand all Loading... |
145 Member<LoadedProperty> m_loadedProperty; | 147 Member<LoadedProperty> m_loadedProperty; |
146 Member<CSSFontFace> m_cssFontFace; | 148 Member<CSSFontFace> m_cssFontFace; |
147 HeapVector<Member<LoadFontCallback>> m_callbacks; | 149 HeapVector<Member<LoadFontCallback>> m_callbacks; |
148 }; | 150 }; |
149 | 151 |
150 using FontFaceArray = HeapVector<Member<FontFace>>; | 152 using FontFaceArray = HeapVector<Member<FontFace>>; |
151 | 153 |
152 } // namespace blink | 154 } // namespace blink |
153 | 155 |
154 #endif // FontFace_h | 156 #endif // FontFace_h |
OLD | NEW |