Beispiel #1
0
nsresult
IDBTransaction::Abort(nsresult aErrorCode)
{
    NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

    return AbortInternal(aErrorCode, DOMError::CreateForNSResult(aErrorCode));
}
Beispiel #2
0
nsresult
IDBTransaction::Abort(IDBRequest* aRequest)
{
    NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
    NS_ASSERTION(aRequest, "This is undesirable.");

    nsCOMPtr<nsIDOMDOMError> error;
    aRequest->GetError(getter_AddRefs(error));

    return AbortInternal(aRequest->GetErrorCode(), error.forget());
}
Beispiel #3
0
void
IDBTransaction::Abort(nsresult aErrorCode)
{
  AssertIsOnOwningThread();

  if (IsCommittingOrDone()) {
    // Already started (and maybe finished) the commit or abort so there is
    // nothing to do here.
    return;
  }

  nsRefPtr<DOMError> error = new DOMError(GetOwner(), aErrorCode);
  AbortInternal(aErrorCode, error.forget());
}
Beispiel #4
0
void
IDBTransaction::Abort(ErrorResult& aRv)
{
  AssertIsOnOwningThread();

  if (IsCommittingOrDone()) {
    aRv = NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
    return;
  }

  AbortInternal(NS_ERROR_DOM_INDEXEDDB_ABORT_ERR, nullptr);

  MOZ_ASSERT(!mAbortedByScript);
  mAbortedByScript = true;
}
Beispiel #5
0
void
IDBTransaction::Abort(IDBRequest* aRequest)
{
  AssertIsOnOwningThread();
  MOZ_ASSERT(aRequest);

  if (IsCommittingOrDone()) {
    // Already started (and maybe finished) the commit or abort so there is
    // nothing to do here.
    return;
  }

  ErrorResult rv;
  nsRefPtr<DOMError> error = aRequest->GetError(rv);

  AbortInternal(aRequest->GetErrorCode(), error.forget());
}