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

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

Issue 76133002: XHR: reset error flag on aborting request that restarts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 | « LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-expected.txt ('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) 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 // 907 //
908 // If, window.onload contains open() and send(), m_loader will be set to 908 // If, window.onload contains open() and send(), m_loader will be set to
909 // non 0 value. So, we cannot continue the outer open(). In such case, 909 // non 0 value. So, we cannot continue the outer open(). In such case,
910 // just abort the outer open() by returning false. 910 // just abort the outer open() by returning false.
911 RefPtr<ThreadableLoader> loader = m_loader.release(); 911 RefPtr<ThreadableLoader> loader = m_loader.release();
912 loader->cancel(); 912 loader->cancel();
913 913
914 // Save to a local variable since we're going to drop protection. 914 // Save to a local variable since we're going to drop protection.
915 bool newLoadStarted = m_loader; 915 bool newLoadStarted = m_loader;
916 916
917 // If abort() called internalAbort() and a nested open() ended up
918 // clearing the error flag, but didn't send(), make sure the error
919 // flag is still set.
920 if (!newLoadStarted)
921 m_error = true;
922
917 if (async == DropProtectionAsync) 923 if (async == DropProtectionAsync)
918 dropProtectionSoon(); 924 dropProtectionSoon();
919 else 925 else
920 dropProtection(); 926 dropProtection();
921 927
922 return !newLoadStarted; 928 return !newLoadStarted;
923 } 929 }
924 930
925 void XMLHttpRequest::clearResponse() 931 void XMLHttpRequest::clearResponse()
926 { 932 {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 { 1376 {
1371 return EventTargetNames::XMLHttpRequest; 1377 return EventTargetNames::XMLHttpRequest;
1372 } 1378 }
1373 1379
1374 ExecutionContext* XMLHttpRequest::executionContext() const 1380 ExecutionContext* XMLHttpRequest::executionContext() const
1375 { 1381 {
1376 return ActiveDOMObject::executionContext(); 1382 return ActiveDOMObject::executionContext();
1377 } 1383 }
1378 1384
1379 } // namespace WebCore 1385 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698