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

Unified Diff: Source/core/fetch/ResourceLoader.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/ResourceLoader.h ('k') | Source/core/fileapi/FileReaderLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceLoader.cpp
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index 9cf69a6f9982d80cc68c56cb436d03214298dee6..ce970227c1985141343f4b35fb2f283b65431f5a 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -346,10 +346,12 @@ bool ResourceLoader::responseNeedsAccessControlCheck() const
return m_options.corsEnabled == IsCORSEnabled;
}
-void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebURLResponse& response)
+void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebURLResponse& response, WebDataConsumerHandle* rawHandle)
{
ASSERT(!response.isNull());
ASSERT(m_state == Initialized);
+ // |rawHandle|'s ownership is transferred to the callee.
+ OwnPtr<WebDataConsumerHandle> handle = adoptPtr(rawHandle);
bool isMultipartPayload = response.isMultipartPayload();
bool isValidStateTransition = (m_connectionState == ConnectionStateStarted || m_connectionState == ConnectionStateReceivedResponse);
@@ -393,7 +395,7 @@ void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebUR
// Reference the object in this method since the additional processing can do
// anything including removing the last reference to this object.
RefPtrWillBeRawPtr<ResourceLoader> protect(this);
- m_resource->responseReceived(resourceResponse);
+ m_resource->responseReceived(resourceResponse, handle.release());
if (m_state == Terminated)
return;
@@ -432,6 +434,11 @@ void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebUR
cancel();
}
+void ResourceLoader::didReceiveResponse(blink::WebURLLoader* loader, const blink::WebURLResponse& response)
+{
+ didReceiveResponse(loader, response, nullptr);
+}
+
void ResourceLoader::didReceiveData(blink::WebURLLoader*, const char* data, int length, int encodedDataLength)
{
ASSERT(m_state != Terminated);
« no previous file with comments | « Source/core/fetch/ResourceLoader.h ('k') | Source/core/fileapi/FileReaderLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698