| 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 13 matching lines...) Expand all Loading... |
| 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/Resource.h" | 29 #include "core/fetch/Resource.h" |
| 30 #include "core/fetch/ResourceClient.h" | 30 #include "core/fetch/ResourceClient.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/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 34 #include "wtf/OwnPtr.h" | 34 #include <memory> |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class FetchRequest; | 38 class FetchRequest; |
| 39 class ResourceFetcher; | 39 class ResourceFetcher; |
| 40 class FontPlatformData; | 40 class FontPlatformData; |
| 41 class FontCustomPlatformData; | 41 class FontCustomPlatformData; |
| 42 class FontResourceClient; | 42 class FontResourceClient; |
| 43 | 43 |
| 44 class FontResource final : public Resource { | 44 class FontResource final : public Resource { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 }; | 78 }; |
| 79 FontResource(const ResourceRequest&, const ResourceLoaderOptions&); | 79 FontResource(const ResourceRequest&, const ResourceLoaderOptions&); |
| 80 | 80 |
| 81 void checkNotify() override; | 81 void checkNotify() override; |
| 82 void fontLoadShortLimitCallback(Timer<FontResource>*); | 82 void fontLoadShortLimitCallback(Timer<FontResource>*); |
| 83 void fontLoadLongLimitCallback(Timer<FontResource>*); | 83 void fontLoadLongLimitCallback(Timer<FontResource>*); |
| 84 | 84 |
| 85 enum LoadLimitState { UnderLimit, ShortLimitExceeded, LongLimitExceeded }; | 85 enum LoadLimitState { UnderLimit, ShortLimitExceeded, LongLimitExceeded }; |
| 86 | 86 |
| 87 OwnPtr<FontCustomPlatformData> m_fontData; | 87 std::unique_ptr<FontCustomPlatformData> m_fontData; |
| 88 String m_otsParsingMessage; | 88 String m_otsParsingMessage; |
| 89 LoadLimitState m_loadLimitState; | 89 LoadLimitState m_loadLimitState; |
| 90 bool m_corsFailed; | 90 bool m_corsFailed; |
| 91 Timer<FontResource> m_fontLoadShortLimitTimer; | 91 Timer<FontResource> m_fontLoadShortLimitTimer; |
| 92 Timer<FontResource> m_fontLoadLongLimitTimer; | 92 Timer<FontResource> m_fontLoadLongLimitTimer; |
| 93 | 93 |
| 94 friend class MemoryCache; | 94 friend class MemoryCache; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 DEFINE_RESOURCE_TYPE_CASTS(Font); | 97 DEFINE_RESOURCE_TYPE_CASTS(Font); |
| 98 | 98 |
| 99 class FontResourceClient : public GarbageCollectedMixin, public ResourceClient { | 99 class FontResourceClient : public GarbageCollectedMixin, public ResourceClient { |
| 100 public: | 100 public: |
| 101 ~FontResourceClient() override {} | 101 ~FontResourceClient() override {} |
| 102 static bool isExpectedType(ResourceClient* client) { return client->getResou
rceClientType() == FontType; } | 102 static bool isExpectedType(ResourceClient* client) { return client->getResou
rceClientType() == FontType; } |
| 103 ResourceClientType getResourceClientType() const final { return FontType; } | 103 ResourceClientType getResourceClientType() const final { return FontType; } |
| 104 virtual void fontLoadShortLimitExceeded(FontResource*) {} | 104 virtual void fontLoadShortLimitExceeded(FontResource*) {} |
| 105 virtual void fontLoadLongLimitExceeded(FontResource*) {} | 105 virtual void fontLoadLongLimitExceeded(FontResource*) {} |
| 106 | 106 |
| 107 DEFINE_INLINE_VIRTUAL_TRACE() {} | 107 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| 111 | 111 |
| 112 #endif | 112 #endif |
| OLD | NEW |