| Index: Source/modules/pushmessaging/PushMessagingError.h
|
| diff --git a/Source/modules/pushmessaging/PushMessagingError.h b/Source/modules/pushmessaging/PushMessagingError.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5fbf82038a64115e7ffc39391873476bd2d2b504
|
| --- /dev/null
|
| +++ b/Source/modules/pushmessaging/PushMessagingError.h
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef PushMessagingError_h
|
| +#define PushMessagingError_h
|
| +
|
| +#include "core/dom/DOMError.h"
|
| +#include "public/platform/WebPushMessagingError.h"
|
| +#include "wtf/PassOwnPtr.h"
|
| +
|
| +namespace WebCore {
|
| +
|
| +class PushMessagingError {
|
| +public:
|
| + // For CallbackPromiseAdapter.
|
| + typedef blink::WebPushMessagingError WebType;
|
| + static PassRefPtr<DOMError> from(WebType* webErrorRaw)
|
| + {
|
| + OwnPtr<WebType> webError = adoptPtr(webErrorRaw);
|
| + RefPtr<DOMError> error = DOMError::create(errorString(webError->errorType), webError->message);
|
| + return error.release();
|
| + }
|
| +
|
| +private:
|
| + static String errorString(blink::WebPushMessagingError::ErrorType);
|
| +
|
| + WTF_MAKE_NONCOPYABLE(PushMessagingError);
|
| + PushMessagingError() WTF_DELETED_FUNCTION;
|
| +};
|
| +
|
| +} // namespace WebCore
|
| +
|
| +#endif // PushMessagingError_h
|
|
|