1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 #include "core/dom/DOMError.h"
9 #include "platform/heap/Handle.h"
10 #include "public/platform/WebPushError.h"
11 #include "wtf/OwnPtr.h"
15 class ScriptPromiseResolverWithContext;
18 WTF_MAKE_NONCOPYABLE(PushError);
20 // For CallbackPromiseAdapter.
21 typedef blink::WebPushError WebType;
22 static PassRefPtrWillBeRawPtr<DOMError> from(ScriptPromiseResolverWithContext*, WebType* webErrorRaw)
24 OwnPtr<WebType> webError = adoptPtr(webErrorRaw);
25 RefPtrWillBeRawPtr<DOMError> error = DOMError::create(errorString(webError->errorType), webError->message);
26 return error.release();
30 static String errorString(blink::WebPushError::ErrorType);
32 PushError() WTF_DELETED_FUNCTION;
35 } // namespace WebCore