Пример #1
0
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));
}
Пример #2
0
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));
}
Пример #3
0
DOMException* createDOMException(ErrorCode code) {
  DCHECK_NE(code, kOK);
  return DOMException::create(errorCodeToExceptionCode(code),
                              errorCodeToMessage(code));
}
Пример #4
0
FileError::FileError(ErrorCode code)
    : DOMError(DOMException::getErrorName(errorCodeToExceptionCode(code)), errorCodeToMessage(code))
    , m_code(code)
{
    ScriptWrappable::init(this);
}