| 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 22 matching lines...) Expand all Loading... |
| 33 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 class ResourceFetcher; | 37 class ResourceFetcher; |
| 38 class FontPlatformData; | 38 class FontPlatformData; |
| 39 class SVGDocument; | 39 class SVGDocument; |
| 40 class SVGFontElement; | 40 class SVGFontElement; |
| 41 class FontCustomPlatformData; | 41 class FontCustomPlatformData; |
| 42 | 42 |
| 43 class FontResource : public Resource { | 43 class FontResource FINAL : public Resource { |
| 44 public: | 44 public: |
| 45 typedef ResourceClient ClientType; | 45 typedef ResourceClient ClientType; |
| 46 | 46 |
| 47 FontResource(const ResourceRequest&); | 47 FontResource(const ResourceRequest&); |
| 48 virtual ~FontResource(); | 48 virtual ~FontResource(); |
| 49 | 49 |
| 50 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&); | 50 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) OVERRIDE; |
| 51 | 51 |
| 52 virtual void didAddClient(ResourceClient*); | 52 virtual void didAddClient(ResourceClient*) OVERRIDE; |
| 53 | 53 |
| 54 virtual void allClientsRemoved(); | 54 virtual void allClientsRemoved() OVERRIDE; |
| 55 void beginLoadIfNeeded(ResourceFetcher* dl); | 55 void beginLoadIfNeeded(ResourceFetcher* dl); |
| 56 bool stillNeedsLoad() const { return !m_loadInitiated; } | 56 virtual bool stillNeedsLoad() const OVERRIDE { return !m_loadInitiated; } |
| 57 | 57 |
| 58 bool ensureCustomFontData(); | 58 bool ensureCustomFontData(); |
| 59 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital
ic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth); | 59 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital
ic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth); |
| 60 | 60 |
| 61 #if ENABLE(SVG_FONTS) | 61 #if ENABLE(SVG_FONTS) |
| 62 bool ensureSVGFontData(); | 62 bool ensureSVGFontData(); |
| 63 SVGFontElement* getSVGFontById(const String&) const; | 63 SVGFontElement* getSVGFontById(const String&) const; |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 virtual void checkNotify(); | 67 virtual void checkNotify() OVERRIDE; |
| 68 OwnPtr<FontCustomPlatformData> m_fontData; | 68 OwnPtr<FontCustomPlatformData> m_fontData; |
| 69 bool m_loadInitiated; | 69 bool m_loadInitiated; |
| 70 | 70 |
| 71 #if ENABLE(SVG_FONTS) | 71 #if ENABLE(SVG_FONTS) |
| 72 RefPtr<WebCore::SVGDocument> m_externalSVGDocument; | 72 RefPtr<WebCore::SVGDocument> m_externalSVGDocument; |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 friend class MemoryCache; | 75 friend class MemoryCache; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 DEFINE_RESOURCE_TYPE_CASTS(Font); | 78 DEFINE_RESOURCE_TYPE_CASTS(Font); |
| 79 | 79 |
| 80 class FontResourceClient : public ResourceClient { | 80 class FontResourceClient : public ResourceClient { |
| 81 public: | 81 public: |
| 82 virtual ~FontResourceClient() { } | 82 virtual ~FontResourceClient() { } |
| 83 static ResourceClientType expectedType() { return FontType; } | 83 static ResourceClientType expectedType() { return FontType; } |
| 84 virtual ResourceClientType resourceClientType() const { return expectedType(
); } | 84 virtual ResourceClientType resourceClientType() const OVERRIDE FINAL { retur
n expectedType(); } |
| 85 virtual void fontLoaded(FontResource*) { } | 85 virtual void fontLoaded(FontResource*) { } |
| 86 virtual void didStartFontLoad(FontResource*) { } | 86 virtual void didStartFontLoad(FontResource*) { } |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } | 89 } |
| 90 | 90 |
| 91 #endif | 91 #endif |
| OLD | NEW |