| 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef FontResource_h | 26 #ifndef FontResource_h |
| 27 #define FontResource_h | 27 #define FontResource_h |
| 28 | 28 |
| 29 #include "core/fetch/ResourceClient.h" | 29 #include "core/fetch/ResourceClient.h" |
| 30 #include "core/fetch/ResourcePtr.h" | 30 #include "core/fetch/ResourcePtr.h" |
| 31 #include "platform/Timer.h" | 31 #include "platform/Timer.h" |
| 32 #include "platform/fonts/FontOrientation.h" | 32 #include "platform/fonts/FontOrientation.h" |
| 33 #include "platform/fonts/FontWidthVariant.h" | |
| 34 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
| 35 | 34 |
| 36 namespace blink { | 35 namespace blink { |
| 37 | 36 |
| 38 class Document; | 37 class Document; |
| 39 class ResourceFetcher; | 38 class ResourceFetcher; |
| 40 class FontPlatformData; | 39 class FontPlatformData; |
| 41 class FontCustomPlatformData; | 40 class FontCustomPlatformData; |
| 42 | 41 |
| 43 class FontResource final : public Resource { | 42 class FontResource final : public Resource { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 57 bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; } | 56 bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; } |
| 58 | 57 |
| 59 bool loadScheduled() const { return m_state != Unloaded; } | 58 bool loadScheduled() const { return m_state != Unloaded; } |
| 60 void didScheduleLoad(); | 59 void didScheduleLoad(); |
| 61 void didUnscheduleLoad(); | 60 void didUnscheduleLoad(); |
| 62 | 61 |
| 63 void setCORSFailed() { m_corsFailed = true; } | 62 void setCORSFailed() { m_corsFailed = true; } |
| 64 bool isCORSFailed() const { return m_corsFailed; } | 63 bool isCORSFailed() const { return m_corsFailed; } |
| 65 | 64 |
| 66 bool ensureCustomFontData(); | 65 bool ensureCustomFontData(); |
| 67 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital
ic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth); | 66 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital
ic, FontOrientation = Horizontal); |
| 68 | 67 |
| 69 protected: | 68 protected: |
| 70 virtual bool isSafeToUnlock() const override; | 69 virtual bool isSafeToUnlock() const override; |
| 71 | 70 |
| 72 private: | 71 private: |
| 73 virtual void checkNotify() override; | 72 virtual void checkNotify() override; |
| 74 void fontLoadWaitLimitCallback(Timer<FontResource>*); | 73 void fontLoadWaitLimitCallback(Timer<FontResource>*); |
| 75 | 74 |
| 76 enum State { Unloaded, LoadScheduled, LoadInitiated }; | 75 enum State { Unloaded, LoadScheduled, LoadInitiated }; |
| 77 | 76 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 static ResourceClientType expectedType() { return FontType; } | 91 static ResourceClientType expectedType() { return FontType; } |
| 93 virtual ResourceClientType resourceClientType() const override final { retur
n expectedType(); } | 92 virtual ResourceClientType resourceClientType() const override final { retur
n expectedType(); } |
| 94 virtual void fontLoaded(FontResource*) { } | 93 virtual void fontLoaded(FontResource*) { } |
| 95 virtual void didStartFontLoad(FontResource*) { } | 94 virtual void didStartFontLoad(FontResource*) { } |
| 96 virtual void fontLoadWaitLimitExceeded(FontResource*) { } | 95 virtual void fontLoadWaitLimitExceeded(FontResource*) { } |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 } | 98 } |
| 100 | 99 |
| 101 #endif | 100 #endif |
| OLD | NEW |