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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2487763003: [ImageLoader 2d] Set DecodeError by calling ResourceLoader::cancel()
Patch Set: Rebase Created 4 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 | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index c9e0ec66b0f1fb819d8619d26ff76cf2801b2948..eab55d4bb8f914c05f68ae89f9f985fa6c281ddd 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -451,12 +451,22 @@ void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
void FrameFetchContext::dispatchDidFail(unsigned long identifier,
const ResourceError& error,
- bool isInternalRequest) {
+ bool isInternalRequest,
+ bool isDecodeError) {
frame()->loader().progress().completeProgress(identifier);
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish",
TRACE_EVENT_SCOPE_THREAD, "data",
InspectorResourceFinishEvent::data(identifier, 0, true));
- InspectorInstrumentation::didFailLoading(frame(), identifier, error);
+ if (isDecodeError) {
+ // In case of DecodeError, pretend as load finish only to inspector, in
+ // order to let inspector to
+ // - show the contents of the Resource, and
+ // - show the Resource in the resources tree.
+ InspectorInstrumentation::didFinishLoading(
+ frame(), identifier, 0, WebURLLoaderClient::kUnknownEncodedDataLength);
+ } else {
+ InspectorInstrumentation::didFailLoading(frame(), identifier, error);
+ }
// Notification to FrameConsole should come AFTER InspectorInstrumentation
// call, DevTools front-end relies on this.
if (!isInternalRequest)
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698