Commit 0ef56662 authored by Peter Beverloo's avatar Peter Beverloo Committed by Commit Bot

Reject BackgroundFetchManager.fetch() with TypeErrors

Change-Id: If91c0fe7a5aec868cca22a132c32e1b2344e5440
Reviewed-on: https://chromium-review.googlesource.com/1152921Reviewed-by: default avatarMugdha Lakhani <nator@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578622}
parent e7b3bd5b
......@@ -294,19 +294,19 @@ void BackgroundFetchManager::DidFetch(
return;
case mojom::blink::BackgroundFetchError::DUPLICATED_DEVELOPER_ID:
DCHECK(!registration);
resolver->Reject(DOMException::Create(
DOMExceptionCode::kInvalidStateError,
resolver->Reject(V8ThrowException::CreateTypeError(
resolver->GetScriptState()->GetIsolate(),
"There already is a registration for the given id."));
return;
case mojom::blink::BackgroundFetchError::STORAGE_ERROR:
DCHECK(!registration);
resolver->Reject(DOMException::Create(
DOMExceptionCode::kAbortError,
resolver->Reject(V8ThrowException::CreateTypeError(
resolver->GetScriptState()->GetIsolate(),
"Failed to store registration due to I/O error."));
return;
case mojom::blink::BackgroundFetchError::SERVICE_WORKER_UNAVAILABLE:
resolver->Reject(DOMException::Create(
DOMExceptionCode::kInvalidStateError,
resolver->Reject(V8ThrowException::CreateTypeError(
resolver->GetScriptState()->GetIsolate(),
"There is no service worker available to service the fetch."));
return;
case mojom::blink::BackgroundFetchError::INVALID_ARGUMENT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment