Commit c8853485 authored by Han Leon's avatar Han Leon Committed by Commit Bot

[ServiceWorker] Remove an unnecessary DCHECK

In the implementations of
ServiceWorkerRegistrationObjectHost.{SetNavigationPreloadHeader,EnableNavigationPreload},
if
ServiceWorkerStorage::{UpdateNavigationPreloadHeader,UpdateNavigationPreloadEnabled}
failed, a ServiceWorkerErrorType::kUnknown error code is sent back to
Blink side, over there it's mapped as an ExceptionCode::kUnknownError to
construct a DOMException to be exported to JavaScript context.

This is an acceptable behavior, as all of other core DOMException codes
are not appropriate to indicate such an storage access failure, and
we're already putting an error message "Failed to access storage." into
the JavaScript DOMException mentioned above.

Based on above explanations, this CL removes an unnecessary DCHECK
against the kUnKnownError in Blink side.

BUG=807239

Change-Id: Ic2222e264139abc000f5a8894bb0b33932b5335d
Reviewed-on: https://chromium-review.googlesource.com/908059Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Han Leon <leon.han@intel.com>
Cr-Commit-Position: refs/heads/master@{#536029}
parent 36f4d544
...@@ -124,7 +124,6 @@ ExceptionParams GetExceptionParams(const WebServiceWorkerError& web_error) { ...@@ -124,7 +124,6 @@ ExceptionParams GetExceptionParams(const WebServiceWorkerError& web_error) {
DOMException* ServiceWorkerError::Take(ScriptPromiseResolver*, DOMException* ServiceWorkerError::Take(ScriptPromiseResolver*,
const WebServiceWorkerError& web_error) { const WebServiceWorkerError& web_error) {
ExceptionParams params = GetExceptionParams(web_error); ExceptionParams params = GetExceptionParams(web_error);
DCHECK_NE(params.code, kUnknownError);
return DOMException::Create(params.code, params.message); return DOMException::Create(params.code, params.message);
} }
......
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