OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
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 29 matching lines...) Expand all Loading... |
40 class FontPlatformData; | 40 class FontPlatformData; |
41 class SVGFontElement; | 41 class SVGFontElement; |
42 class FontCustomPlatformData; | 42 class FontCustomPlatformData; |
43 | 43 |
44 class FontResource FINAL : public Resource { | 44 class FontResource FINAL : public Resource { |
45 public: | 45 public: |
46 typedef ResourceClient ClientType; | 46 typedef ResourceClient ClientType; |
47 | 47 |
48 FontResource(const ResourceRequest&); | 48 FontResource(const ResourceRequest&); |
49 virtual ~FontResource(); | 49 virtual ~FontResource(); |
| 50 virtual void trace(Visitor*) OVERRIDE; |
50 | 51 |
51 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) OVERRIDE; | 52 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) OVERRIDE; |
52 | 53 |
53 virtual void didAddClient(ResourceClient*) OVERRIDE; | 54 virtual void didAddClient(ResourceClient*) OVERRIDE; |
54 | 55 |
55 virtual void allClientsRemoved() OVERRIDE; | 56 virtual void allClientsRemoved() OVERRIDE; |
56 void beginLoadIfNeeded(ResourceFetcher* dl); | 57 void beginLoadIfNeeded(ResourceFetcher* dl); |
57 virtual bool stillNeedsLoad() const OVERRIDE { return !m_loadInitiated; } | 58 virtual bool stillNeedsLoad() const OVERRIDE { return !m_loadInitiated; } |
58 bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; } | 59 bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; } |
59 | 60 |
(...skipping 15 matching lines...) Expand all Loading... |
75 virtual void checkNotify() OVERRIDE; | 76 virtual void checkNotify() OVERRIDE; |
76 void fontLoadWaitLimitCallback(Timer<FontResource>*); | 77 void fontLoadWaitLimitCallback(Timer<FontResource>*); |
77 | 78 |
78 OwnPtr<FontCustomPlatformData> m_fontData; | 79 OwnPtr<FontCustomPlatformData> m_fontData; |
79 bool m_loadInitiated; | 80 bool m_loadInitiated; |
80 bool m_exceedsFontLoadWaitLimit; | 81 bool m_exceedsFontLoadWaitLimit; |
81 bool m_corsFailed; | 82 bool m_corsFailed; |
82 Timer<FontResource> m_fontLoadWaitLimitTimer; | 83 Timer<FontResource> m_fontLoadWaitLimitTimer; |
83 | 84 |
84 #if ENABLE(SVG_FONTS) | 85 #if ENABLE(SVG_FONTS) |
85 RefPtrWillBePersistent<Document> m_externalSVGDocument; | 86 RefPtrWillBeMember<Document> m_externalSVGDocument; |
86 #endif | 87 #endif |
87 | 88 |
88 friend class MemoryCache; | 89 friend class MemoryCache; |
89 }; | 90 }; |
90 | 91 |
91 DEFINE_RESOURCE_TYPE_CASTS(Font); | 92 DEFINE_RESOURCE_TYPE_CASTS(Font); |
92 | 93 |
93 class FontResourceClient : public ResourceClient { | 94 class FontResourceClient : public ResourceClient { |
94 public: | 95 public: |
95 virtual ~FontResourceClient() { } | 96 virtual ~FontResourceClient() { } |
96 static ResourceClientType expectedType() { return FontType; } | 97 static ResourceClientType expectedType() { return FontType; } |
97 virtual ResourceClientType resourceClientType() const OVERRIDE FINAL { retur
n expectedType(); } | 98 virtual ResourceClientType resourceClientType() const OVERRIDE FINAL { retur
n expectedType(); } |
98 virtual void fontLoaded(FontResource*) { } | 99 virtual void fontLoaded(FontResource*) { } |
99 virtual void didStartFontLoad(FontResource*) { } | 100 virtual void didStartFontLoad(FontResource*) { } |
100 virtual void fontLoadWaitLimitExceeded(FontResource*) { } | 101 virtual void fontLoadWaitLimitExceeded(FontResource*) { } |
101 }; | 102 }; |
102 | 103 |
103 } | 104 } |
104 | 105 |
105 #endif | 106 #endif |
OLD | NEW |