| Index: Source/core/fetch/FontResource.cpp
|
| diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
|
| index 52ab3a1a1157bced05ad972bd5de4a3eb810c12d..1e99662cdbb3e9131f258cefe5b562f10c87ccc1 100644
|
| --- a/Source/core/fetch/FontResource.cpp
|
| +++ b/Source/core/fetch/FontResource.cpp
|
| @@ -76,7 +76,7 @@ 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)
|
| @@ -95,6 +95,18 @@ void FontResource::trace(Visitor* visitor)
|
| 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.
|
| @@ -112,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);
|
|
|
|
|