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

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

Issue 2211353003: Remove code to block sync XHRs during microtask executions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 { 625 {
626 if (!getExecutionContext()) 626 if (!getExecutionContext())
627 return false; 627 return false;
628 628
629 if (m_state != kOpened || m_loader) { 629 if (m_state != kOpened || m_loader) {
630 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED."); 630 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED.");
631 return false; 631 return false;
632 } 632 }
633 633
634 if (!m_async && exceptionState.isolate() && v8::MicrotasksScope::IsRunningMi crotasks(exceptionState.isolate())) { 634 if (!m_async && exceptionState.isolate() && v8::MicrotasksScope::IsRunningMi crotasks(exceptionState.isolate())) {
635 Deprecation::countDeprecation(getExecutionContext(), UseCounter::During_ Microtask_SyncXHR); 635 UseCounter::count(getExecutionContext(), UseCounter::During_Microtask_Sy ncXHR);
636 if (RuntimeEnabledFeatures::disableBlockingMethodsDuringMicrotasksEnable d()) {
637 exceptionState.throwDOMException(InvalidAccessError, "Cannot send() synchronous requests during microtask execution.");
638 return false;
639 }
640 } 636 }
641 637
642 638
643 m_error = false; 639 m_error = false;
644 return true; 640 return true;
645 } 641 }
646 642
647 void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrSt ringOrFormData& body, ExceptionState& exceptionState) 643 void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrSt ringOrFormData& body, ExceptionState& exceptionState)
648 { 644 {
649 InspectorInstrumentation::willSendXMLHttpOrFetchNetworkRequest(getExecutionC ontext(), url()); 645 InspectorInstrumentation::willSendXMLHttpOrFetchNetworkRequest(getExecutionC ontext(), url());
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 1716
1721 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) 1717 DEFINE_TRACE_WRAPPERS(XMLHttpRequest)
1722 { 1718 {
1723 visitor->traceWrappers(m_responseBlob); 1719 visitor->traceWrappers(m_responseBlob);
1724 visitor->traceWrappers(m_responseLegacyStream); 1720 visitor->traceWrappers(m_responseLegacyStream);
1725 visitor->traceWrappers(m_responseDocument); 1721 visitor->traceWrappers(m_responseDocument);
1726 visitor->traceWrappers(m_responseArrayBuffer); 1722 visitor->traceWrappers(m_responseArrayBuffer);
1727 } 1723 }
1728 1724
1729 } // namespace blink 1725 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Deprecation.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698