| Index: Source/core/fetch/FontResource.cpp
|
| diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
|
| index a3c882487103a984b51a8fe88037a8436616f84b..152d46e57c629498e522a054039041f410239227 100644
|
| --- a/Source/core/fetch/FontResource.cpp
|
| +++ b/Source/core/fetch/FontResource.cpp
|
| @@ -44,9 +44,13 @@
|
|
|
| namespace WebCore {
|
|
|
| +static const double fontLoadWaitLimitSec = 3.0;
|
| +
|
| FontResource::FontResource(const ResourceRequest& resourceRequest)
|
| : Resource(resourceRequest, Font)
|
| , m_loadInitiated(false)
|
| + , m_exceedsFontLoadWaitLimit(false)
|
| + , m_fontLoadWaitLimitTimer(this, &FontResource::fontLoadWaitLimitCallback)
|
| {
|
| }
|
|
|
| @@ -74,6 +78,7 @@ void FontResource::beginLoadIfNeeded(ResourceFetcher* dl)
|
| if (!m_loadInitiated) {
|
| m_loadInitiated = true;
|
| Resource::load(dl, m_options);
|
| + m_fontLoadWaitLimitTimer.startOneShot(fontLoadWaitLimitSec);
|
|
|
| ResourceClientWalker<FontResourceClient> walker(m_clients);
|
| while (FontResourceClient* client = walker.next())
|
| @@ -155,6 +160,16 @@ SVGFontElement* FontResource::getSVGFontById(const String& fontName) const
|
| }
|
| #endif
|
|
|
| +void FontResource::fontLoadWaitLimitCallback(Timer<FontResource>*)
|
| +{
|
| + if (!isLoading())
|
| + return;
|
| + m_exceedsFontLoadWaitLimit = true;
|
| + ResourceClientWalker<FontResourceClient> walker(m_clients);
|
| + while (FontResourceClient* client = walker.next())
|
| + client->fontLoadWaitLimitExceeded(this);
|
| +}
|
| +
|
| void FontResource::allClientsRemoved()
|
| {
|
| m_fontData.clear();
|
| @@ -163,6 +178,7 @@ void FontResource::allClientsRemoved()
|
|
|
| void FontResource::checkNotify()
|
| {
|
| + m_fontLoadWaitLimitTimer.stop();
|
| ResourceClientWalker<FontResourceClient> w(m_clients);
|
| while (FontResourceClient* c = w.next())
|
| c->fontLoaded(this);
|
|
|