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

Unified Diff: Source/core/loader/DocumentThreadableLoader.cpp

Issue 1150413003: [XHR] Ignore didReceiveData when having a DataConsumerHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentThreadableLoader.cpp
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index ae1d7a904da4066a0e7f741b9d8faf72fe05feca..62e9fb8df84713649ab0a804a4c409b8987e1e97 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -88,6 +88,7 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document& document, Threadabl
, m_securityOrigin(m_resourceLoaderOptions.securityOrigin)
, m_sameOriginRequest(securityOrigin()->canRequest(request.url()))
, m_crossOriginNonSimpleRequest(false)
+ , m_isUsingDataConsumerHandle(false)
, m_async(blockingBehavior == LoadAsynchronously)
, m_requestContext(request.requestContext())
, m_timeoutTimer(this, &DocumentThreadableLoader::didTimeout)
@@ -373,6 +374,9 @@ void DocumentThreadableLoader::responseReceived(Resource* resource, const Resour
ASSERT_UNUSED(resource, resource == this->resource());
ASSERT(m_async);
+ if (handle)
+ m_isUsingDataConsumerHandle = true;
+
handleResponse(resource->identifier(), response, handle);
}
@@ -465,6 +469,9 @@ void DocumentThreadableLoader::dataReceived(Resource* resource, const char* data
ASSERT_UNUSED(resource, resource == this->resource());
ASSERT(m_async);
+ if (m_isUsingDataConsumerHandle)
+ return;
+
handleReceivedData(data, dataLength);
}
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698