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

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

Issue 15725010: Guard ResourceLoader::didReceiveData in error case. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add comment Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/ResourceLoader.cpp
diff --git a/Source/core/loader/ResourceLoader.cpp b/Source/core/loader/ResourceLoader.cpp
index a4ca06f1696c03bcbba697ffc6a7322891364623..965f6b26d1fbd4c7a2f58f5e63b731b00e4929a7 100644
--- a/Source/core/loader/ResourceLoader.cpp
+++ b/Source/core/loader/ResourceLoader.cpp
@@ -354,6 +354,10 @@ void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse&
void ResourceLoader::didReceiveData(ResourceHandle*, const char* data, int length, int encodedDataLength)
{
+ // It is possible to receive data on uninitialized resources if it had an error status code, and we are running a nested message
+ // loop. When this occurs, ignoring the data is the correct action.
+ if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors())
+ return;
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(m_frame.get(), identifier(), encodedDataLength);
ASSERT(m_state == Initialized);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698