Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
|
bashi
2014/07/30 11:32:26
Just to show an example
| |
| 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 |
| 11 * copyright notice, this list of conditions and the following disclaimer | 11 * copyright notice, this list of conditions and the following disclaimer |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 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 "bindings/core/v8/ScriptWrappable.h" |
| 36 #include "core/CSSPropertyNames.h" | 36 #include "core/CSSPropertyNames.h" |
| 37 #include "core/css/CSSValue.h" | 37 #include "core/css/CSSValue.h" |
| 38 #include "core/css/FontFaceDescriptors.h" | |
| 38 #include "core/dom/DOMError.h" | 39 #include "core/dom/DOMError.h" |
| 39 #include "platform/fonts/FontTraits.h" | 40 #include "platform/fonts/FontTraits.h" |
| 40 #include "wtf/PassRefPtr.h" | 41 #include "wtf/PassRefPtr.h" |
| 41 #include "wtf/RefCounted.h" | 42 #include "wtf/RefCounted.h" |
| 42 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 class CSSFontFace; | 47 class CSSFontFace; |
| 47 class CSSValueList; | 48 class CSSValueList; |
| 48 class Dictionary; | |
| 49 class Document; | 49 class Document; |
| 50 class ExceptionState; | 50 class ExceptionState; |
| 51 class FontFaceReadyPromiseResolver; | 51 class FontFaceReadyPromiseResolver; |
| 52 class StylePropertySet; | 52 class StylePropertySet; |
| 53 class StyleRuleFontFace; | 53 class StyleRuleFontFace; |
| 54 | 54 |
| 55 class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub lic ScriptWrappable { | 55 class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub lic ScriptWrappable { |
| 56 public: | 56 public: |
| 57 enum LoadStatus { Unloaded, Loading, Loaded, Error }; | 57 enum LoadStatus { Unloaded, Loading, Loaded, Error }; |
| 58 | 58 |
| 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<ArrayBuffer> source, const FontFaceDescriptors*, Ex ceptionState&); |
| 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, PassRefPtr<ArrayBufferView>, const FontFaceDescriptors*, Excep tionState&); |
| 61 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 FontFaceDescriptors*, ExceptionSta te&); |
| 62 static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFon tFace*); | 62 static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFon tFace*); |
| 63 | 63 |
| 64 ~FontFace(); | 64 ~FontFace(); |
| 65 | 65 |
| 66 const AtomicString& family() const { return m_family; } | 66 const AtomicString& family() const { return m_family; } |
| 67 String style() const; | 67 String style() const; |
| 68 String weight() const; | 68 String weight() const; |
| 69 String stretch() const; | 69 String stretch() const; |
| 70 String unicodeRange() const; | 70 String unicodeRange() const; |
| 71 String variant() const; | 71 String variant() const; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; | 131 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; |
| 132 OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; | 132 OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; |
| 133 WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback> > m_callbacks; | 133 WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback> > m_callbacks; |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 typedef WillBeHeapVector<RefPtrWillBeMember<FontFace> > FontFaceArray; | 136 typedef WillBeHeapVector<RefPtrWillBeMember<FontFace> > FontFaceArray; |
| 137 | 137 |
| 138 } // namespace blink | 138 } // namespace blink |
| 139 | 139 |
| 140 #endif // FontFace_h | 140 #endif // FontFace_h |
| OLD | NEW |