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

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

Issue 138843009: Notify when resource with error code >= 400 is finished. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Source/devtools/front_end/NetworkPanel.js » ('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 0d2d6c42ed04fc51e7f457bb0548394533e55709..5d15c81739858d5360703015f50533897cfbc505 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -86,6 +86,7 @@ ResourceLoader::~ResourceLoader()
void ResourceLoader::releaseResources()
{
+ ASSERT(m_notifiedLoadComplete);
ASSERT(m_state != Terminated);
m_requestCountTracker.clear();
m_host->didLoadResource(m_resource);
@@ -247,7 +248,10 @@ void ResourceLoader::cancel(const ResourceError& error)
m_loader.clear();
}
- m_host->didFailLoading(m_resource, nonNullError);
+ if (!m_notifiedLoadComplete) {
+ m_notifiedLoadComplete = true;
+ m_host->didFailLoading(m_resource, nonNullError);
+ }
if (m_state == Finishing)
m_resource->error(Resource::LoadError);
@@ -352,8 +356,13 @@ void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebUR
if (m_resource->response().httpStatusCode() < 400 || m_resource->shouldIgnoreHTTPStatusCodeErrors())
return;
+
m_state = Finishing;
m_resource->error(Resource::LoadError);
+ if (!m_notifiedLoadComplete) {
Nate Chapin 2014/01/31 17:25:52 I'm not sure this is safe. Specifically, if m_reso
eustas 2014/02/03 12:56:06 Done.
+ m_notifiedLoadComplete = true;
+ m_host->didFinishLoading(m_resource, monotonicallyIncreasingTime());
+ }
cancel();
}
« no previous file with comments | « no previous file | Source/devtools/front_end/NetworkPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698