Lines Matching defs:exceptionState
26 #include "bindings/v8/ExceptionState.h"
218 ScriptString XMLHttpRequest::responseText(ExceptionState& exceptionState)
221 exceptionState.throwDOMException(InvalidStateError, "The value is only accessible if the object's 'responseType' is '' or 'text' (was '" + responseType() + "').");
238 Document* XMLHttpRequest::responseXML(ExceptionState& exceptionState)
241 exceptionState.throwDOMException(InvalidStateError, "The value is only accessible if the object's 'responseType' is '' or 'document' (was '" + responseType() + "').");
341 void XMLHttpRequest::setTimeout(unsigned long timeout, ExceptionState& exceptionState)
346 exceptionState.throwDOMException(InvalidAccessError, "Timeouts cannot be set for synchronous requests made from a document.");
352 void XMLHttpRequest::setResponseType(const String& responseType, ExceptionState& exceptionState)
355 exceptionState.throwDOMException(InvalidStateError, "The response type cannot be set if the object's state is LOADING or DONE.");
362 exceptionState.throwDOMException(InvalidAccessError, "The response type can only be changed for asynchronous HTTP requests made from a document.");
483 void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionState)
486 exceptionState.throwDOMException(InvalidStateError, "The value may only be set if the object's state is UNSENT or OPENED.");
541 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, ExceptionState& exceptionState)
543 open(method, url, true, exceptionState);
546 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, ExceptionState& exceptionState)
565 exceptionState.throwDOMException(SyntaxError, "'" + method + "' is not a valid HTTP method.");
570 exceptionState.throwSecurityError("'" + method + "' HTTP method is unsupported.");
576 exceptionState.throwSecurityError("Refused to connect to '" + url.elidedString() + "' because it violates the document's Content Security Policy.");
582 exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests are disabled for this page.");
589 exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests from a document must not set a response type.");
595 exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests must not set a timeout.");
616 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, ExceptionState& exceptionState)
621 open(method, urlWithCredentials, async, exceptionState);
624 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, const String& password, ExceptionState& exceptionState)
630 open(method, urlWithCredentials, async, exceptionState);
633 bool XMLHttpRequest::initSend(ExceptionState& exceptionState)
639 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED.");
647 void XMLHttpRequest::send(ExceptionState& exceptionState)
649 send(String(), exceptionState);
657 void XMLHttpRequest::send(Document* document, ExceptionState& exceptionState)
663 if (!initSend(exceptionState))
684 createRequest(httpBody.release(), exceptionState);
687 void XMLHttpRequest::send(const String& body, ExceptionState& exceptionState)
691 if (!initSend(exceptionState))
710 createRequest(httpBody.release(), exceptionState);
713 void XMLHttpRequest::send(Blob* body, ExceptionState& exceptionState)
717 if (!initSend(exceptionState))
749 createRequest(httpBody.release(), exceptionState);
752 void XMLHttpRequest::send(DOMFormData* body, ExceptionState& exceptionState)
756 if (!initSend(exceptionState))
770 createRequest(httpBody.release(), exceptionState);
773 void XMLHttpRequest::send(ArrayBuffer* body, ExceptionState& exceptionState)
782 sendBytesData(body->data(), body->byteLength(), exceptionState);
785 void XMLHttpRequest::send(ArrayBufferView* body, ExceptionState& exceptionState)
791 sendBytesData(body->baseAddress(), body->byteLength(), exceptionState);
794 void XMLHttpRequest::sendBytesData(const void* data, size_t length, ExceptionState& exceptionState)
796 if (!initSend(exceptionState))
807 createRequest(httpBody.release(), exceptionState);
810 void XMLHttpRequest::sendForInspectorXHRReplay(PassRefPtr<FormData> formData, ExceptionState& exceptionState)
812 createRequest(formData ? formData->deepCopy() : nullptr, exceptionState);
813 m_exceptionCode = exceptionState.code();
816 void XMLHttpRequest::createRequest(PassRefPtr<FormData> httpBody, ExceptionState& exceptionState)
820 exceptionState.throwDOMException(NetworkError, "'GET' is the only method allowed for 'blob:' URLs.");
909 exceptionState.throwDOMException(m_exceptionCode, "Failed to load '" + m_url.elidedString() + "'.");
1112 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicString& value, ExceptionState& exceptionState)
1115 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED.");
1120 exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a valid HTTP header field name.");
1125 exceptionState.throwDOMException(SyntaxError, "'" + value + "' is not a valid HTTP header field value.");