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

Unified Diff: Source/core/events/PromiseRejectionEvent.h

Issue 1179113007: Implement onunhandledrejection / onrejectionhandled events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 5 years, 6 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/core/events/EventTypeNames.in ('k') | Source/core/events/PromiseRejectionEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/PromiseRejectionEvent.h
diff --git a/Source/core/events/PromiseRejectionEvent.h b/Source/core/events/PromiseRejectionEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..394698fef9e3dae9966bbec4f0d6f91194daaeec
--- /dev/null
+++ b/Source/core/events/PromiseRejectionEvent.h
@@ -0,0 +1,47 @@
+// Copyright 2015 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 PromiseRejectionEvent_h
+#define PromiseRejectionEvent_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "core/CoreExport.h"
+#include "core/events/Event.h"
+#include "core/events/PromiseRejectionEventInit.h"
+
+namespace blink {
+
+class CORE_EXPORT PromiseRejectionEvent : public Event {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create()
+ {
+ return adoptRefWillBeNoop(new PromiseRejectionEvent);
+ }
+ static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create(const AtomicString& type, const PromiseRejectionEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new PromiseRejectionEvent(type, initializer));
+ }
+
+ ScriptValue reason() const { return m_reason; }
+ ScriptPromise promise() const { return m_promise; }
+
+ virtual const AtomicString& interfaceName() const override;
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ PromiseRejectionEvent();
+ PromiseRejectionEvent(const AtomicString& type, ScriptPromise, ScriptValue reason);
+ PromiseRejectionEvent(const AtomicString&, const PromiseRejectionEventInit&);
+ ~PromiseRejectionEvent() override;
+
+ ScriptPromise m_promise;
+ ScriptValue m_reason;
+};
+
+} // namespace blink
+
+#endif // PromiseRejectionEvent_h
« no previous file with comments | « Source/core/events/EventTypeNames.in ('k') | Source/core/events/PromiseRejectionEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698