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

Unified Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 22842002: Stop throwing DOM exceptions in internal 'XMLHttpRequest' response getters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moar. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index e65a4a720fdbfada888d91a162972db8b908dfab..9dc97ee7509cd4ae2a148c472ff68bf20c0d3840 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -260,12 +260,10 @@ Document* XMLHttpRequest::responseXML(ExceptionState& es)
return m_responseDocument.get();
}
-Blob* XMLHttpRequest::responseBlob(ExceptionState& es)
+Blob* XMLHttpRequest::responseBlob()
{
- if (m_responseTypeCode != ResponseTypeBlob) {
- es.throwDOMException(InvalidStateError);
- return 0;
- }
+ ASSERT(m_responseTypeCode == ResponseTypeBlob);
+
// We always return null before DONE.
if (m_error || m_state != DONE)
return 0;
@@ -295,12 +293,9 @@ Blob* XMLHttpRequest::responseBlob(ExceptionState& es)
return m_responseBlob.get();
}
-ArrayBuffer* XMLHttpRequest::responseArrayBuffer(ExceptionState& es)
+ArrayBuffer* XMLHttpRequest::responseArrayBuffer()
{
- if (m_responseTypeCode != ResponseTypeArrayBuffer) {
- es.throwDOMException(InvalidStateError);
- return 0;
- }
+ ASSERT(m_responseTypeCode == ResponseTypeArrayBuffer);
if (m_error || m_state != DONE)
return 0;
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698