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

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

Issue 478223002: XMLHttpRequest::overrideMimeType should throw InvalidStateError (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tyoshino-san review Created 6 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') | Source/core/xml/XMLHttpRequest.idl » ('j') | 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 30c501640c68d1f1d7c453ae08f7ca615b3f6e22..82177442b8837cf04c73b695ae6c8633dca5b886 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -1033,12 +1033,14 @@ void XMLHttpRequest::handleRequestError(ExceptionCode exceptionCode, const Atomi
dispatchProgressEvent(EventTypeNames::loadend, receivedLength, expectedLength);
}
-void XMLHttpRequest::overrideMimeType(const AtomicString& override)
+void XMLHttpRequest::overrideMimeType(const AtomicString& mimeType, ExceptionState& exceptionState)
{
- // FIXME: This method must throw an InvalidStateError exception when the
- // XHR is in the LOADING or DONE state. http://crbug.com/402375
+ if (m_state == LOADING || m_state == DONE) {
+ exceptionState.throwDOMException(InvalidStateError, "MimeType cannot be overridden when the state is LOADING or DONE.");
+ return;
+ }
- m_mimeTypeOverride = override;
+ m_mimeTypeOverride = mimeType;
}
void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicString& value, ExceptionState& exceptionState)
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | Source/core/xml/XMLHttpRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698