| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #ifndef PushMessagingError_h |
| 6 #define PushMessagingError_h |
| 7 |
| 8 #include "core/dom/DOMError.h" |
| 9 #include "public/platform/WebPushMessagingError.h" |
| 10 #include "wtf/PassOwnPtr.h" |
| 11 |
| 12 namespace WebCore { |
| 13 |
| 14 class PushMessagingError { |
| 15 public: |
| 16 // For CallbackPromiseAdapter. |
| 17 typedef blink::WebPushMessagingError WebType; |
| 18 static PassRefPtr<DOMError> from(WebType* webErrorRaw) |
| 19 { |
| 20 OwnPtr<WebType> webError = adoptPtr(webErrorRaw); |
| 21 RefPtr<DOMError> error = DOMError::create(errorString(webError->errorTyp
e), webError->message); |
| 22 return error.release(); |
| 23 } |
| 24 |
| 25 private: |
| 26 static String errorString(blink::WebPushMessagingError::ErrorType); |
| 27 |
| 28 WTF_MAKE_NONCOPYABLE(PushMessagingError); |
| 29 PushMessagingError() WTF_DELETED_FUNCTION; |
| 30 }; |
| 31 |
| 32 } // namespace WebCore |
| 33 |
| 34 #endif // PushMessagingError_h |
| OLD | NEW |