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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 "devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", 444 "devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data",
445 InspectorResourceFinishEvent::data(identifier, finishTime, false)); 445 InspectorResourceFinishEvent::data(identifier, finishTime, false));
446 InspectorInstrumentation::didFinishLoading(frame(), identifier, finishTime, 446 InspectorInstrumentation::didFinishLoading(frame(), identifier, finishTime,
447 encodedDataLength); 447 encodedDataLength);
448 if (frame()->frameScheduler()) 448 if (frame()->frameScheduler())
449 frame()->frameScheduler()->didStopLoading(identifier); 449 frame()->frameScheduler()->didStopLoading(identifier);
450 } 450 }
451 451
452 void FrameFetchContext::dispatchDidFail(unsigned long identifier, 452 void FrameFetchContext::dispatchDidFail(unsigned long identifier,
453 const ResourceError& error, 453 const ResourceError& error,
454 bool isInternalRequest) { 454 bool isInternalRequest,
455 bool isDecodeError) {
455 frame()->loader().progress().completeProgress(identifier); 456 frame()->loader().progress().completeProgress(identifier);
456 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", 457 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish",
457 TRACE_EVENT_SCOPE_THREAD, "data", 458 TRACE_EVENT_SCOPE_THREAD, "data",
458 InspectorResourceFinishEvent::data(identifier, 0, true)); 459 InspectorResourceFinishEvent::data(identifier, 0, true));
459 InspectorInstrumentation::didFailLoading(frame(), identifier, error); 460 if (isDecodeError) {
461 // In case of DecodeError, pretend as load finish only to inspector, in
462 // order to let inspector to
463 // - show the contents of the Resource, and
464 // - show the Resource in the resources tree.
465 InspectorInstrumentation::didFinishLoading(
466 frame(), identifier, 0, WebURLLoaderClient::kUnknownEncodedDataLength);
467 } else {
468 InspectorInstrumentation::didFailLoading(frame(), identifier, error);
469 }
460 // Notification to FrameConsole should come AFTER InspectorInstrumentation 470 // Notification to FrameConsole should come AFTER InspectorInstrumentation
461 // call, DevTools front-end relies on this. 471 // call, DevTools front-end relies on this.
462 if (!isInternalRequest) 472 if (!isInternalRequest)
463 frame()->console().didFailLoading(identifier, error); 473 frame()->console().didFailLoading(identifier, error);
464 if (frame()->frameScheduler()) 474 if (frame()->frameScheduler())
465 frame()->frameScheduler()->didStopLoading(identifier); 475 frame()->frameScheduler()->didStopLoading(identifier);
466 } 476 }
467 477
468 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache( 478 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(
469 unsigned long identifier, 479 unsigned long identifier,
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 response); 1018 response);
1009 } 1019 }
1010 1020
1011 DEFINE_TRACE(FrameFetchContext) { 1021 DEFINE_TRACE(FrameFetchContext) {
1012 visitor->trace(m_document); 1022 visitor->trace(m_document);
1013 visitor->trace(m_documentLoader); 1023 visitor->trace(m_documentLoader);
1014 FetchContext::trace(visitor); 1024 FetchContext::trace(visitor);
1015 } 1025 }
1016 1026
1017 } // namespace blink 1027 } // namespace blink
OLDNEW
« 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