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

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: Created 6 years, 1 month 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
« no previous file with comments | « Source/core/fetch/RawResource.h ('k') | Source/core/fetch/RawResourceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/RawResource.cpp
diff --git a/Source/core/fetch/RawResource.cpp b/Source/core/fetch/RawResource.cpp
index ca3ac711c32fdad52e60c73ae97e62fc0f219d37..5bd97e15d4c4cce1034513ae661bfc40d54f267e 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);
+ 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)
« no previous file with comments | « Source/core/fetch/RawResource.h ('k') | Source/core/fetch/RawResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698