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

Side by Side Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 2231523002: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, resolve comment rewrap conflicts. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org>
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org>
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved.
6 * Copyright (C) 2012 Intel Corporation 6 * Copyright (C) 2012 Intel Corporation
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 1461
1462 void XMLHttpRequest::didFail(const ResourceError& error) { 1462 void XMLHttpRequest::didFail(const ResourceError& error) {
1463 NETWORK_DVLOG(1) << this << " didFail()"; 1463 NETWORK_DVLOG(1) << this << " didFail()";
1464 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); 1464 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel);
1465 1465
1466 // If we are already in an error state, for instance we called abort(), bail 1466 // If we are already in an error state, for instance we called abort(), bail
1467 // out early. 1467 // out early.
1468 if (m_error) 1468 if (m_error)
1469 return; 1469 return;
1470 1470
1471 if (error.isCancellation()) { 1471 // Internally, access check violations are considered `cancellations`, but
1472 // at least the mixed-content and CSP specs require them to be surfaced as
1473 // network errors to the page. See:
1474 // [1] https://www.w3.org/TR/mixed-content/#algorithms,
1475 // [2] https://www.w3.org/TR/CSP3/#fetch-integration.
1476 if (error.isCancellation() && !error.isAccessCheck()) {
1472 handleDidCancel(); 1477 handleDidCancel();
1473 return; 1478 return;
1474 } 1479 }
1475 1480
1476 if (error.isTimeout()) { 1481 if (error.isTimeout()) {
1477 handleDidTimeout(); 1482 handleDidTimeout();
1478 return; 1483 return;
1479 } 1484 }
1480 1485
1481 // Network failures are already reported to Web Inspector by ResourceLoader. 1486 // Network failures are already reported to Web Inspector by ResourceLoader.
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 visitor->traceWrappers(m_responseLegacyStream); 1856 visitor->traceWrappers(m_responseLegacyStream);
1852 visitor->traceWrappers(m_responseDocument); 1857 visitor->traceWrappers(m_responseDocument);
1853 visitor->traceWrappers(m_responseArrayBuffer); 1858 visitor->traceWrappers(m_responseArrayBuffer);
1854 } 1859 }
1855 1860
1856 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { 1861 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) {
1857 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); 1862 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr);
1858 } 1863 }
1859 1864
1860 } // namespace blink 1865 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698