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

Unified Diff: Source/bindings/v8/custom/V8PromiseResolverCustom.cpp

Issue 16838012: [ABANDONED] Implement Promises. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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/bindings/v8/custom/V8PromiseCustom.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8PromiseResolverCustom.cpp
diff --git a/Source/core/css/CSSFontFaceLoadEvent.cpp b/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp
similarity index 66%
copy from Source/core/css/CSSFontFaceLoadEvent.cpp
copy to Source/bindings/v8/custom/V8PromiseResolverCustom.cpp
index 80ca0c9b0a27dd55d75448736ed30f092f0f5385..57442556ef7d269ddf74804fd1537f16d4b8b7be 100644
--- a/Source/core/css/CSSFontFaceLoadEvent.cpp
+++ b/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp
@@ -29,38 +29,27 @@
*/
#include "config.h"
-#include "core/css/CSSFontFaceLoadEvent.h"
+#include "V8PromiseResolver.h"
-namespace WebCore {
-
-CSSFontFaceLoadEvent::CSSFontFaceLoadEvent()
-{
- ScriptWrappable::init(this);
-}
+#include "bindings/v8/V8PromiseUtilities.h"
+#include <v8.h>
-CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, PassRefPtr<CSSFontFaceRule> fontface, PassRefPtr<DOMError> error)
- : Event(type, false, false)
- , m_fontface(fontface)
- , m_error(error)
-{
- ScriptWrappable::init(this);
-}
+namespace WebCore {
-CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, const CSSFontFaceLoadEventInit& initializer)
- : Event(type, initializer)
- , m_fontface(initializer.fontface)
- , m_error(initializer.error)
+void V8PromiseResolver::fulfillMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
- ScriptWrappable::init(this);
+ v8SetReturnValue(args, V8PromiseUtilities::callUnwrappedMethod("fulfill", args, V8PromiseUtilities::promiseResolverPrototype(args.GetIsolate())));
}
-CSSFontFaceLoadEvent::~CSSFontFaceLoadEvent()
+void V8PromiseResolver::resolveMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
+ v8SetReturnValue(args, V8PromiseUtilities::callUnwrappedMethod("resolve", args, V8PromiseUtilities::promiseResolverPrototype(args.GetIsolate())));
}
-const AtomicString& CSSFontFaceLoadEvent::interfaceName() const
+void V8PromiseResolver::rejectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
- return eventNames().interfaceForCSSFontFaceLoadEvent;
+ v8SetReturnValue(args, V8PromiseUtilities::callUnwrappedMethod("reject", args, V8PromiseUtilities::promiseResolverPrototype(args.GetIsolate())));
}
} // namespace WebCore
+
« no previous file with comments | « Source/bindings/v8/custom/V8PromiseCustom.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698