X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Ffetch%2FFontResource.h;h=07401b96304c08d34a8bb206ec93a7e46c0be596;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=51f353bb014de4c21dc222fd0d5004ab8ad226ce;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/fetch/FontResource.h b/src/third_party/WebKit/Source/core/fetch/FontResource.h index 51f353b..07401b9 100644 --- a/src/third_party/WebKit/Source/core/fetch/FontResource.h +++ b/src/third_party/WebKit/Source/core/fetch/FontResource.h @@ -33,7 +33,7 @@ #include "platform/fonts/FontWidthVariant.h" #include "wtf/OwnPtr.h" -namespace WebCore { +namespace blink { class Document; class ResourceFetcher; @@ -47,6 +47,7 @@ public: FontResource(const ResourceRequest&); virtual ~FontResource(); + virtual void trace(Visitor*) OVERRIDE; virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) OVERRIDE; @@ -54,9 +55,16 @@ public: virtual void allClientsRemoved() OVERRIDE; void beginLoadIfNeeded(ResourceFetcher* dl); - virtual bool stillNeedsLoad() const OVERRIDE { return !m_loadInitiated; } + virtual bool stillNeedsLoad() const OVERRIDE { return m_state != LoadInitiated; } bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; } + bool loadScheduled() const { return m_state != Unloaded; } + void didScheduleLoad(); + void didUnscheduleLoad(); + + void setCORSFailed() { m_corsFailed = true; } + bool isCORSFailed() const { return m_corsFailed; } + bool ensureCustomFontData(); FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth); @@ -72,13 +80,16 @@ private: virtual void checkNotify() OVERRIDE; void fontLoadWaitLimitCallback(Timer*); + enum State { Unloaded, LoadScheduled, LoadInitiated }; + OwnPtr m_fontData; - bool m_loadInitiated; + State m_state; bool m_exceedsFontLoadWaitLimit; + bool m_corsFailed; Timer m_fontLoadWaitLimitTimer; #if ENABLE(SVG_FONTS) - RefPtrWillBePersistent m_externalSVGDocument; + RefPtrWillBeMember m_externalSVGDocument; #endif friend class MemoryCache;