| Index: third_party/WebKit/Source/core/fetch/Resource.cpp
|
| diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| index d0de8259a3b53162531e2bb2d529296f5f0cf925..bbbd21cb1516b4429b89819dc92ab7a23a14f075 100644
|
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| @@ -665,7 +665,7 @@ void Resource::didAddClient(ResourceClient* c) {
|
| }
|
| }
|
|
|
| -static bool shouldSendCachedDataSynchronouslyForType(Resource::Type type) {
|
| +static bool typeNeedsSynchronousCacheHit(Resource::Type type) {
|
| // Some resources types default to return data synchronously. For most of
|
| // these, it's because there are layout tests that expect data to return
|
| // synchronously in case of cache hit. In the case of fonts, there was a
|
| @@ -717,11 +717,10 @@ void Resource::addClient(ResourceClient* client,
|
| return;
|
| }
|
|
|
| - // If we have existing data to send to the new client and the resource type
|
| - // supprts it, send it asynchronously.
|
| - if (!m_response.isNull() &&
|
| - !shouldSendCachedDataSynchronouslyForType(getType()) &&
|
| - !m_needsSynchronousCacheHit) {
|
| + // If an error has occurred or we have existing data to send to the new client
|
| + // and the resource type supprts it, send it asynchronously.
|
| + if ((errorOccurred() || !m_response.isNull()) &&
|
| + !typeNeedsSynchronousCacheHit(getType()) && !m_needsSynchronousCacheHit) {
|
| m_clientsAwaitingCallback.add(client);
|
| ResourceCallback::callbackHandler().schedule(this);
|
| return;
|
|
|