void FileError::throwDOMException(ExceptionState& exceptionState, ErrorCode code) { if (code == FileError::OK) return; // SecurityError is special-cased, as we want to route those exceptions through ExceptionState::throwSecurityError. if (code == FileError::SECURITY_ERR) { exceptionState.throwSecurityError(FileError::securityErrorMessage); return; } exceptionState.throwDOMException(errorCodeToExceptionCode(code), errorCodeToMessage(code)); }
void throwDOMException(ExceptionState& exceptionState, ErrorCode code) { if (code == kOK) return; // SecurityError is special-cased, as we want to route those exceptions // through ExceptionState::throwSecurityError. if (code == kSecurityErr) { exceptionState.throwSecurityError(securityErrorMessage); return; } exceptionState.throwDOMException(errorCodeToExceptionCode(code), errorCodeToMessage(code)); }
DOMException* createDOMException(ErrorCode code) { DCHECK_NE(code, kOK); return DOMException::create(errorCodeToExceptionCode(code), errorCodeToMessage(code)); }
FileError::FileError(ErrorCode code) : DOMError(DOMException::getErrorName(errorCodeToExceptionCode(code)), errorCodeToMessage(code)) , m_code(code) { ScriptWrappable::init(this); }