Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1411)

Unified Diff: Source/modules/pushmessaging/PushMessagingError.h

Issue 152763002: DO NOT REVIEW Bindings and plumbing for push messaging API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Address some review comments. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/pushmessaging/PushManager.idl ('k') | Source/modules/pushmessaging/PushMessagingError.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/modules/pushmessaging/PushManager.idl ('k') | Source/modules/pushmessaging/PushMessagingError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698