X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Ffetch%2FFontResource.cpp;h=1e99662cdbb3e9131f258cefe5b562f10c87ccc1;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=22df8287e6c165e3061f981429fe32d1d6a2f1f4;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/fetch/FontResource.cpp b/src/third_party/WebKit/Source/core/fetch/FontResource.cpp index 22df828..1e99662 100644 --- a/src/third_party/WebKit/Source/core/fetch/FontResource.cpp +++ b/src/third_party/WebKit/Source/core/fetch/FontResource.cpp @@ -43,7 +43,7 @@ #include "core/svg/SVGFontElement.h" #endif -namespace WebCore { +namespace blink { static const double fontLoadWaitLimitSec = 3.0; @@ -76,8 +76,9 @@ static void recordPackageFormatHistogram(FontPackageFormat format) FontResource::FontResource(const ResourceRequest& resourceRequest) : Resource(resourceRequest, Font) - , m_loadInitiated(false) + , m_state(Unloaded) , m_exceedsFontLoadWaitLimit(false) + , m_corsFailed(false) , m_fontLoadWaitLimitTimer(this, &FontResource::fontLoadWaitLimitCallback) { } @@ -86,6 +87,26 @@ FontResource::~FontResource() { } +void FontResource::trace(Visitor* visitor) +{ +#if ENABLE(SVG_FONTS) + visitor->trace(m_externalSVGDocument); +#endif + Resource::trace(visitor); +} + +void FontResource::didScheduleLoad() +{ + if (m_state == Unloaded) + m_state = LoadScheduled; +} + +void FontResource::didUnscheduleLoad() +{ + if (m_state == LoadScheduled) + m_state = Unloaded; +} + void FontResource::load(ResourceFetcher*, const ResourceLoaderOptions& options) { // Don't load the file yet. Wait for an access before triggering the load. @@ -103,8 +124,8 @@ void FontResource::didAddClient(ResourceClient* c) void FontResource::beginLoadIfNeeded(ResourceFetcher* dl) { - if (!m_loadInitiated) { - m_loadInitiated = true; + if (m_state != LoadInitiated) { + m_state = LoadInitiated; Resource::load(dl, m_options); m_fontLoadWaitLimitTimer.startOneShot(fontLoadWaitLimitSec, FROM_HERE); @@ -177,7 +198,7 @@ SVGFontElement* FontResource::getSVGFontById(const String& fontName) const if (!collectionLength) return 0; -#ifndef NDEBUG +#if ENABLE(ASSERT) for (unsigned i = 0; i < collectionLength; ++i) { ASSERT(collection->item(i)); ASSERT(isSVGFontElement(collection->item(i)));