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 adf843dd7e9831f464f8fd72224979f566c5ea9f..8502fa14053e91eedf6df6fe33edae06b404ff59 100644 |
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
@@ -656,7 +656,7 @@ void Resource::didAddClient(ResourceClient* c) |
} |
} |
-static bool shouldSendCachedDataSynchronouslyForType(Resource::Type type) |
+static bool shouldSendCachedDataOrErrorSynchronouslyForType(Resource::Type type) |
Nate Chapin
2016/08/09 22:43:23
This name was already too long :/ Maybe typeNeeds
engedy
2016/08/17 16:41:56
Done.
|
{ |
// Some resources types default to return data synchronously. |
// For most of these, it's because there are layout tests that |
@@ -705,8 +705,8 @@ 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()) && !shouldSendCachedDataOrErrorSynchronouslyForType(getType()) && !m_needsSynchronousCacheHit) { |
m_clientsAwaitingCallback.add(client); |
ResourceCallback::callbackHandler().schedule(this); |
return; |