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

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

Issue 2271033003: Suppress cancellation notification in XMLHttpRequest::endLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 3 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
« no previous file with comments | « no previous file | 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) 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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 m_parsedResponse = true; 1465 m_parsedResponse = true;
1466 1466
1467 endLoading(); 1467 endLoading();
1468 } 1468 }
1469 1469
1470 void XMLHttpRequest::endLoading() 1470 void XMLHttpRequest::endLoading()
1471 { 1471 {
1472 InspectorInstrumentation::didFinishXHRLoading(getExecutionContext(), this, t his, m_method, m_url); 1472 InspectorInstrumentation::didFinishXHRLoading(getExecutionContext(), this, t his, m_method, m_url);
1473 1473
1474 if (m_loader) { 1474 if (m_loader) {
1475 const bool hasError = m_error;
1476 // Set |m_error| in order to suppress the cancel notification (see
1477 // XMLHttpRequest::didFail).
1478 m_error = true;
1475 m_loader->cancel(); 1479 m_loader->cancel();
1480 m_error = hasError;
1476 m_loader = nullptr; 1481 m_loader = nullptr;
1477 } 1482 }
1478 1483
1479 changeState(kDone); 1484 changeState(kDone);
1480 1485
1481 if (!getExecutionContext()->isDocument() || !document() || !document()->fram e() || !document()->frame()->page()) 1486 if (!getExecutionContext()->isDocument() || !document() || !document()->fram e() || !document()->frame()->page())
1482 return; 1487 return;
1483 1488
1484 if (status() >= 200 && status() < 300) { 1489 if (status() >= 200 && status() < 300) {
1485 document()->frame()->page()->chromeClient().ajaxSucceeded(document()->fr ame()); 1490 document()->frame()->page()->chromeClient().ajaxSucceeded(document()->fr ame());
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 visitor->traceWrappers(m_responseDocument); 1723 visitor->traceWrappers(m_responseDocument);
1719 visitor->traceWrappers(m_responseArrayBuffer); 1724 visitor->traceWrappers(m_responseArrayBuffer);
1720 } 1725 }
1721 1726
1722 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) 1727 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr)
1723 { 1728 {
1724 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); 1729 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr);
1725 } 1730 }
1726 1731
1727 } // namespace blink 1732 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698