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