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

Side by Side Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 462053002: [XHR] Call internalAbort() before firing events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« 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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 } 975 }
976 976
977 void XMLHttpRequest::handleNetworkError() 977 void XMLHttpRequest::handleNetworkError()
978 { 978 {
979 WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this); 979 WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this);
980 980
981 // Response is cleared next, save needed progress event data. 981 // Response is cleared next, save needed progress event data.
982 long long expectedLength = m_response.expectedContentLength(); 982 long long expectedLength = m_response.expectedContentLength();
983 long long receivedLength = m_receivedLength; 983 long long receivedLength = m_receivedLength;
984 984
985 if (!internalAbort())
986 return;
987
985 handleDidFailGeneric(); 988 handleDidFailGeneric();
986 handleRequestError(NetworkError, EventTypeNames::error, receivedLength, expe ctedLength); 989 handleRequestError(NetworkError, EventTypeNames::error, receivedLength, expe ctedLength);
987 internalAbort();
988 } 990 }
989 991
990 void XMLHttpRequest::handleDidCancel() 992 void XMLHttpRequest::handleDidCancel()
991 { 993 {
992 WTF_LOG(Network, "XMLHttpRequest %p handleDidCancel()", this); 994 WTF_LOG(Network, "XMLHttpRequest %p handleDidCancel()", this);
993 995
994 // Response is cleared next, save needed progress event data. 996 // Response is cleared next, save needed progress event data.
995 long long expectedLength = m_response.expectedContentLength(); 997 long long expectedLength = m_response.expectedContentLength();
996 long long receivedLength = m_receivedLength; 998 long long receivedLength = m_receivedLength;
997 999
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 { 1418 {
1417 visitor->trace(m_responseBlob); 1419 visitor->trace(m_responseBlob);
1418 visitor->trace(m_responseStream); 1420 visitor->trace(m_responseStream);
1419 visitor->trace(m_responseDocument); 1421 visitor->trace(m_responseDocument);
1420 visitor->trace(m_progressEventThrottle); 1422 visitor->trace(m_progressEventThrottle);
1421 visitor->trace(m_upload); 1423 visitor->trace(m_upload);
1422 XMLHttpRequestEventTarget::trace(visitor); 1424 XMLHttpRequestEventTarget::trace(visitor);
1423 } 1425 }
1424 1426
1425 } // namespace blink 1427 } // 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