| 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 1647d362c10f7a3787b83946b6dbdfb9d2cb23a5..9d064c23ec0e30a3280c3ffa439990ec40f3c075 100644
|
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| @@ -645,7 +645,7 @@ void Resource::didAddClient(ResourceClient* c) {
|
| }
|
| }
|
|
|
| -static bool typeNeedsSynchronousCacheHit(Resource::Type type) {
|
| +static bool shouldSendCachedDataSynchronouslyForType(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
|
| @@ -695,10 +695,11 @@ void Resource::addClient(ResourceClient* client,
|
| return;
|
| }
|
|
|
| - // 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) {
|
| + // 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) {
|
| m_clientsAwaitingCallback.add(client);
|
| ResourceCallback::callbackHandler().schedule(this);
|
| return;
|
|
|