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 met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 16 matching lines...) Expand all Loading... |
27 #define FontFaceSet_h | 27 #define FontFaceSet_h |
28 | 28 |
29 #include "bindings/core/v8/Iterable.h" | 29 #include "bindings/core/v8/Iterable.h" |
30 #include "bindings/core/v8/ScriptPromise.h" | 30 #include "bindings/core/v8/ScriptPromise.h" |
31 #include "core/css/FontFace.h" | 31 #include "core/css/FontFace.h" |
32 #include "core/dom/ActiveDOMObject.h" | 32 #include "core/dom/ActiveDOMObject.h" |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "core/events/EventListener.h" | 34 #include "core/events/EventListener.h" |
35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
36 #include "platform/AsyncMethodRunner.h" | 36 #include "platform/AsyncMethodRunner.h" |
37 #include "platform/RefCountedSupplement.h" | |
38 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
39 #include "wtf/Allocator.h" | 38 #include "wtf/Allocator.h" |
40 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
41 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
42 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
43 | 42 |
44 // Mac OS X 10.6 SDK defines check() macro that interfares with our check() meth
od | 43 // Mac OS X 10.6 SDK defines check() macro that interfares with our check() meth
od |
45 #ifdef check | 44 #ifdef check |
46 #undef check | 45 #undef check |
47 #endif | 46 #endif |
48 | 47 |
49 namespace blink { | 48 namespace blink { |
50 | 49 |
51 class CSSFontFace; | 50 class CSSFontFace; |
52 class CSSFontFaceSource; | 51 class CSSFontFaceSource; |
53 class CSSFontSelector; | 52 class CSSFontSelector; |
54 class Dictionary; | 53 class Dictionary; |
55 class ExceptionState; | 54 class ExceptionState; |
56 class Font; | 55 class Font; |
57 class FontFaceCache; | 56 class FontFaceCache; |
58 class FontResource; | 57 class FontResource; |
59 class ExecutionContext; | 58 class ExecutionContext; |
60 | 59 |
61 using FontFaceSetIterable = PairIterable<Member<FontFace>, Member<FontFace>>; | 60 using FontFaceSetIterable = PairIterable<Member<FontFace>, Member<FontFace>>; |
62 | 61 |
63 #if ENABLE(OILPAN) | 62 class FontFaceSet final : public EventTargetWithInlineData, public Supplement<Do
cument>, public ActiveDOMObject, public FontFaceSetIterable { |
64 class FontFaceSet final : public EventTargetWithInlineData, public HeapSupplemen
t<Document>, public ActiveDOMObject, public FontFaceSetIterable { | |
65 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); | 63 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); |
66 using SupplementType = HeapSupplement<Document>; | |
67 #else | |
68 class FontFaceSet final : public EventTargetWithInlineData, public RefCountedSup
plement<Document, FontFaceSet>, public ActiveDOMObject, public FontFaceSetIterab
le { | |
69 REFCOUNTED_EVENT_TARGET(FontFaceSet); | |
70 using SupplementType = RefCountedSupplement<Document, FontFaceSet>; | |
71 #endif | |
72 DEFINE_WRAPPERTYPEINFO(); | 64 DEFINE_WRAPPERTYPEINFO(); |
73 public: | 65 public: |
74 ~FontFaceSet() override; | 66 ~FontFaceSet() override; |
75 | 67 |
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); | 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); |
77 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); | 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); |
78 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); | 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); |
79 | 71 |
80 bool check(const String& font, const String& text, ExceptionState&); | 72 bool check(const String& font, const String& text, ExceptionState&); |
81 ScriptPromise load(ScriptState*, const String& font, const String& text); | 73 ScriptPromise load(ScriptState*, const String& font, const String& text); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 HeapListHashSet<Member<FontFace>> m_nonCSSConnectedFaces; | 169 HeapListHashSet<Member<FontFace>> m_nonCSSConnectedFaces; |
178 | 170 |
179 Member<AsyncMethodRunner<FontFaceSet>> m_asyncRunner; | 171 Member<AsyncMethodRunner<FontFaceSet>> m_asyncRunner; |
180 | 172 |
181 FontLoadHistogram m_histogram; | 173 FontLoadHistogram m_histogram; |
182 }; | 174 }; |
183 | 175 |
184 } // namespace blink | 176 } // namespace blink |
185 | 177 |
186 #endif // FontFaceSet_h | 178 #endif // FontFaceSet_h |
OLD | NEW |