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

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: Address comment from japhet@. 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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 1358
1359 void XMLHttpRequest::didFail(const ResourceError& error) 1359 void XMLHttpRequest::didFail(const ResourceError& error)
1360 { 1360 {
1361 NETWORK_DVLOG(1) << this << " didFail()"; 1361 NETWORK_DVLOG(1) << this << " didFail()";
1362 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); 1362 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel);
1363 1363
1364 // If we are already in an error state, for instance we called abort(), bail out early. 1364 // If we are already in an error state, for instance we called abort(), bail out early.
1365 if (m_error) 1365 if (m_error)
1366 return; 1366 return;
1367 1367
1368 if (error.isCancellation()) { 1368 if (error.isCancellation() && !error.isAccessCheck()) {
1369 handleDidCancel(); 1369 handleDidCancel();
1370 return; 1370 return;
1371 } 1371 }
1372 1372
1373 if (error.isTimeout()) { 1373 if (error.isTimeout()) {
1374 handleDidTimeout(); 1374 handleDidTimeout();
1375 return; 1375 return;
1376 } 1376 }
1377 1377
1378 // Network failures are already reported to Web Inspector by ResourceLoader. 1378 // Network failures are already reported to Web Inspector by ResourceLoader.
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 visitor->traceWrappers(m_responseDocument); 1755 visitor->traceWrappers(m_responseDocument);
1756 visitor->traceWrappers(m_responseArrayBuffer); 1756 visitor->traceWrappers(m_responseArrayBuffer);
1757 } 1757 }
1758 1758
1759 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) 1759 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr)
1760 { 1760 {
1761 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); 1761 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr);
1762 } 1762 }
1763 1763
1764 } // namespace blink 1764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698