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

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

Issue 1274063003: [Loader] Make ThreadableLoader non-RefCounted and be managed by OwnPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 4 years, 9 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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 if (!m_loader) 1011 if (!m_loader)
1012 return true; 1012 return true;
1013 1013
1014 // Cancelling the ThreadableLoader m_loader may result in calling 1014 // Cancelling the ThreadableLoader m_loader may result in calling
1015 // window.onload synchronously. If such an onload handler contains open() 1015 // window.onload synchronously. If such an onload handler contains open()
1016 // call on the same XMLHttpRequest object, reentry happens. 1016 // call on the same XMLHttpRequest object, reentry happens.
1017 // 1017 //
1018 // If, window.onload contains open() and send(), m_loader will be set to 1018 // If, window.onload contains open() and send(), m_loader will be set to
1019 // non 0 value. So, we cannot continue the outer open(). In such case, 1019 // non 0 value. So, we cannot continue the outer open(). In such case,
1020 // just abort the outer open() by returning false. 1020 // just abort the outer open() by returning false.
1021 RefPtr<ThreadableLoader> loader = m_loader.release(); 1021 OwnPtr<ThreadableLoader> loader = m_loader.release();
1022 loader->cancel(); 1022 loader->cancel();
1023 1023
1024 // If abort() called internalAbort() and a nested open() ended up 1024 // If abort() called internalAbort() and a nested open() ended up
1025 // clearing the error flag, but didn't send(), make sure the error 1025 // clearing the error flag, but didn't send(), make sure the error
1026 // flag is still set. 1026 // flag is still set.
1027 bool newLoadStarted = m_loader; 1027 bool newLoadStarted = m_loader;
1028 if (!newLoadStarted) 1028 if (!newLoadStarted)
1029 m_error = true; 1029 m_error = true;
1030 1030
1031 return !newLoadStarted; 1031 return !newLoadStarted;
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 visitor->trace(m_responseDocumentParser); 1701 visitor->trace(m_responseDocumentParser);
1702 visitor->trace(m_progressEventThrottle); 1702 visitor->trace(m_progressEventThrottle);
1703 visitor->trace(m_upload); 1703 visitor->trace(m_upload);
1704 visitor->trace(m_blobLoader); 1704 visitor->trace(m_blobLoader);
1705 XMLHttpRequestEventTarget::trace(visitor); 1705 XMLHttpRequestEventTarget::trace(visitor);
1706 DocumentParserClient::trace(visitor); 1706 DocumentParserClient::trace(visitor);
1707 ActiveDOMObject::trace(visitor); 1707 ActiveDOMObject::trace(visitor);
1708 } 1708 }
1709 1709
1710 } // namespace blink 1710 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698