Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 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/ScriptPromiseProperty.h" | 35 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 36 #include "bindings/core/v8/ScriptWrappable.h" | 36 #include "bindings/core/v8/ScriptWrappable.h" |
| 37 #include "core/CSSPropertyNames.h" | 37 #include "core/CSSPropertyNames.h" |
| 38 #include "core/css/CSSValue.h" | 38 #include "core/css/CSSValue.h" |
| 39 #include "core/dom/ActiveDOMObject.h" | 39 #include "core/dom/ContextLifecycleObserver.h" |
| 40 #include "core/dom/DOMException.h" | 40 #include "core/dom/DOMException.h" |
| 41 #include "platform/fonts/FontTraits.h" | 41 #include "platform/fonts/FontTraits.h" |
| 42 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
| 43 #include "wtf/RefCounted.h" | 43 #include "wtf/RefCounted.h" |
| 44 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class CSSFontFace; | 48 class CSSFontFace; |
| 49 class CSSValue; | 49 class CSSValue; |
| 50 class DOMArrayBuffer; | 50 class DOMArrayBuffer; |
| 51 class DOMArrayBufferView; | 51 class DOMArrayBufferView; |
| 52 class Document; | 52 class Document; |
| 53 class ExceptionState; | 53 class ExceptionState; |
| 54 class FontFaceDescriptors; | 54 class FontFaceDescriptors; |
| 55 class StringOrArrayBufferOrArrayBufferView; | 55 class StringOrArrayBufferOrArrayBufferView; |
| 56 class StylePropertySet; | 56 class StylePropertySet; |
| 57 class StyleRuleFontFace; | 57 class StyleRuleFontFace; |
| 58 | 58 |
| 59 class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub lic ScriptWrappable, public ActiveDOMObject { | 59 class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub lic ScriptWrappable, public ContextLifecycleObserver { |
| 60 DEFINE_WRAPPERTYPEINFO(); | 60 DEFINE_WRAPPERTYPEINFO(); |
| 61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FontFace); | 61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FontFace); |
| 62 public: | 62 public: |
| 63 enum LoadStatusType { Unloaded, Loading, Loaded, Error }; | 63 enum LoadStatusType { Unloaded, Loading, Loaded, Error }; |
| 64 | 64 |
| 65 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, StringOrArrayBufferOrArrayBufferView&, const FontFaceDescripto rs&); | 65 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, StringOrArrayBufferOrArrayBufferView&, const FontFaceDescripto rs&); |
| 66 static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFon tFace*); | 66 static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFon tFace*); |
| 67 | 67 |
| 68 ~FontFace(); | 68 virtual ~FontFace(); |
|
sof
2016/02/29 08:38:51
The "virtual" won't be needed with !OILPAN, right?
haraken
2016/02/29 08:58:00
Done.
| |
| 69 | 69 |
| 70 const AtomicString& family() const { return m_family; } | 70 const AtomicString& family() const { return m_family; } |
| 71 String style() const; | 71 String style() const; |
| 72 String weight() const; | 72 String weight() const; |
| 73 String stretch() const; | 73 String stretch() const; |
| 74 String unicodeRange() const; | 74 String unicodeRange() const; |
| 75 String variant() const; | 75 String variant() const; |
| 76 String featureSettings() const; | 76 String featureSettings() const; |
| 77 | 77 |
| 78 // FIXME: Changing these attributes should affect font matching. | 78 // FIXME: Changing these attributes should affect font matching. |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 102 | 102 |
| 103 class LoadFontCallback : public RefCountedWillBeGarbageCollectedFinalized<Lo adFontCallback> { | 103 class LoadFontCallback : public RefCountedWillBeGarbageCollectedFinalized<Lo adFontCallback> { |
| 104 public: | 104 public: |
| 105 virtual ~LoadFontCallback() { } | 105 virtual ~LoadFontCallback() { } |
| 106 virtual void notifyLoaded(FontFace*) = 0; | 106 virtual void notifyLoaded(FontFace*) = 0; |
| 107 virtual void notifyError(FontFace*) = 0; | 107 virtual void notifyError(FontFace*) = 0; |
| 108 DEFINE_INLINE_VIRTUAL_TRACE() { } | 108 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 109 }; | 109 }; |
| 110 void loadWithCallback(PassRefPtrWillBeRawPtr<LoadFontCallback>, ExecutionCon text*); | 110 void loadWithCallback(PassRefPtrWillBeRawPtr<LoadFontCallback>, ExecutionCon text*); |
| 111 | 111 |
| 112 // ActiveDOMObject | |
| 113 bool hasPendingActivity() const override; | 112 bool hasPendingActivity() const override; |
| 114 | 113 |
| 115 private: | 114 private: |
| 116 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescriptors&) ; | 115 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescriptors&) ; |
| 117 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, PassRefPtr<DOMArrayBufferView>, const FontFaceDescriptors&); | 116 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, PassRefPtr<DOMArrayBufferView>, const FontFaceDescriptors&); |
| 118 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, const String& source, const FontFaceDescriptors&); | 117 static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const Atom icString& family, const String& source, const FontFaceDescriptors&); |
| 119 | 118 |
| 120 explicit FontFace(ExecutionContext*); | 119 explicit FontFace(ExecutionContext*); |
| 121 FontFace(ExecutionContext*, const AtomicString& family, const FontFaceDescri ptors&); | 120 FontFace(ExecutionContext*, const AtomicString& family, const FontFaceDescri ptors&); |
| 122 | 121 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 146 PersistentWillBeMember<LoadedProperty> m_loadedProperty; | 145 PersistentWillBeMember<LoadedProperty> m_loadedProperty; |
| 147 OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; | 146 OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; |
| 148 WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback>> m_callbacks; | 147 WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback>> m_callbacks; |
| 149 }; | 148 }; |
| 150 | 149 |
| 151 using FontFaceArray = WillBeHeapVector<RefPtrWillBeMember<FontFace>>; | 150 using FontFaceArray = WillBeHeapVector<RefPtrWillBeMember<FontFace>>; |
| 152 | 151 |
| 153 } // namespace blink | 152 } // namespace blink |
| 154 | 153 |
| 155 #endif // FontFace_h | 154 #endif // FontFace_h |
| OLD | NEW |