Chromium Code Reviews| 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..159cd6b09c927ac35e6cb313c53507424fc1b017 |
| --- /dev/null |
| +++ b/Source/modules/pushmessaging/PushMessagingError.h |
| @@ -0,0 +1,33 @@ |
| +// 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) |
|
Peter Beverloo
2014/03/10 13:59:28
RefPtrWillBeRawPtr<DOMError>
Michael van Ouwerkerk
2014/03/10 15:12:04
Punting.
|
| + { |
| + 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); |
|
Peter Beverloo
2014/03/10 13:59:28
micro nit: I would place a blank line above this,
Michael van Ouwerkerk
2014/03/10 15:12:04
Done.
|
| + PushMessagingError() WTF_DELETED_FUNCTION; |
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif // PushMessagingError_h |