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

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

Issue 2624163002: [XHR] Add CHECK to make sure XHR::m_loader is not silently released (Closed)
Patch Set: fix Created 3 years, 11 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 1034
1035 m_exceptionCode = 0; 1035 m_exceptionCode = 0;
1036 m_error = false; 1036 m_error = false;
1037 1037
1038 if (m_async) { 1038 if (m_async) {
1039 UseCounter::count(&executionContext, 1039 UseCounter::count(&executionContext,
1040 UseCounter::XMLHttpRequestAsynchronous); 1040 UseCounter::XMLHttpRequestAsynchronous);
1041 if (m_upload) 1041 if (m_upload)
1042 request.setReportUploadProgress(true); 1042 request.setReportUploadProgress(true);
1043 1043
1044 DCHECK(!m_loader); 1044 // TODO(yhirano): Turn this CHECK into DCHECK once https://crbug.com/667254
1045 // is fixed.
1046 CHECK(!m_loader);
1045 DCHECK(m_sendFlag); 1047 DCHECK(m_sendFlag);
1046 m_loader = ThreadableLoader::create(executionContext, this, options, 1048 m_loader = ThreadableLoader::create(executionContext, this, options,
1047 resourceLoaderOptions); 1049 resourceLoaderOptions);
1048 m_loader->start(request); 1050 m_loader->start(request);
1049 1051
1050 return; 1052 return;
1051 } 1053 }
1052 1054
1055 // TODO(yhirano): Remove this CHECK once https://crbug.com/667254 is fixed.
1056 CHECK(!m_loader);
1053 // Use count for XHR synchronous requests. 1057 // Use count for XHR synchronous requests.
1054 UseCounter::count(&executionContext, UseCounter::XMLHttpRequestSynchronous); 1058 UseCounter::count(&executionContext, UseCounter::XMLHttpRequestSynchronous);
1055 ThreadableLoader::loadResourceSynchronously(executionContext, request, *this, 1059 ThreadableLoader::loadResourceSynchronously(executionContext, request, *this,
1056 options, resourceLoaderOptions); 1060 options, resourceLoaderOptions);
1057 1061
1058 throwForLoadFailureIfNeeded(exceptionState, String()); 1062 throwForLoadFailureIfNeeded(exceptionState, String());
1059 } 1063 }
1060 1064
1061 void XMLHttpRequest::abort() { 1065 void XMLHttpRequest::abort() {
1062 NETWORK_DVLOG(1) << this << " abort()"; 1066 NETWORK_DVLOG(1) << this << " abort()";
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 visitor->traceWrappers(m_responseDocument); 1847 visitor->traceWrappers(m_responseDocument);
1844 visitor->traceWrappers(m_responseArrayBuffer); 1848 visitor->traceWrappers(m_responseArrayBuffer);
1845 XMLHttpRequestEventTarget::traceWrappers(visitor); 1849 XMLHttpRequestEventTarget::traceWrappers(visitor);
1846 } 1850 }
1847 1851
1848 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { 1852 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) {
1849 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); 1853 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr);
1850 } 1854 }
1851 1855
1852 } // namespace blink 1856 } // 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