Chromium Code Reviews| Index: Source/core/fetch/RawResource.cpp |
| diff --git a/Source/core/fetch/RawResource.cpp b/Source/core/fetch/RawResource.cpp |
| index ca3ac711c32fdad52e60c73ae97e62fc0f219d37..f416cf04b5a4dec3c275f69825a12921bd209a6c 100644 |
| --- a/Source/core/fetch/RawResource.cpp |
| +++ b/Source/core/fetch/RawResource.cpp |
| @@ -65,7 +65,7 @@ void RawResource::didAddClient(ResourceClient* c) |
| } |
| if (!m_response.isNull()) |
| - client->responseReceived(this, m_response); |
| + client->responseReceived(this, m_response, nullptr); |
| if (!hasClient(c)) |
| return; |
| if (m_data) |
| @@ -94,13 +94,17 @@ void RawResource::updateRequest(const ResourceRequest& request) |
| c->updateRequest(this, request); |
| } |
| -void RawResource::responseReceived(const ResourceResponse& response) |
| +void RawResource::responseReceived(const ResourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle) |
| { |
| InternalResourcePtr protect(this); |
| - Resource::responseReceived(response); |
| + Resource::responseReceived(response, nullptr); |
| ResourceClientWalker<RawResourceClient> w(m_clients); |
| - while (RawResourceClient* c = w.next()) |
| - c->responseReceived(this, m_response); |
| + ASSERT(count() == 1 || !handle); |
|
Mike West
2014/11/04 15:09:30
Can 'count()' be 0?
yhirano
2014/11/05 04:38:40
Done.
|
| + while (RawResourceClient* c = w.next()) { |
| + // |handle| is cleared when passed, but it's not a problem because |
| + // |handle| is null when there are two or more clients, as asserted. |
| + c->responseReceived(this, m_response, handle); |
| + } |
| } |
| void RawResource::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) |