Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1034)

Unified Diff: Source/core/fetch/RawResource.cpp

Issue 603903003: [Streams] Pass WebDataConsumerHandle when the response arrives. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@web-data-pipe
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698