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

Unified Diff: Source/bindings/v8/custom/V8PromiseCustom.h

Issue 17505004: Introduce 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
Index: Source/bindings/v8/custom/V8PromiseCustom.h
diff --git a/Source/modules/webaudio/AudioBufferCallback.h b/Source/bindings/v8/custom/V8PromiseCustom.h
similarity index 71%
copy from Source/modules/webaudio/AudioBufferCallback.h
copy to Source/bindings/v8/custom/V8PromiseCustom.h
index 8a6c8c606f72750447a9a033d5c8560fcddcbe31..47b64a45ee42e9367b979e579008b06193acb5ec 100644
--- a/Source/modules/webaudio/AudioBufferCallback.h
+++ b/Source/bindings/v8/custom/V8PromiseCustom.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, Google Inc. All rights reserved.
+ * Copyright (C) 2013, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -22,25 +22,30 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef AudioBufferCallback_h
-#define AudioBufferCallback_h
+#ifndef V8PromiseCustom_h
+#define V8PromiseCustom_h
-#if ENABLE(WEB_AUDIO)
-
-#include "wtf/RefCounted.h"
+#include <v8.h>
namespace WebCore {
-class AudioBuffer;
-
-class AudioBufferCallback : public RefCounted<AudioBufferCallback> {
+class V8PromiseCustom {
public:
- virtual ~AudioBufferCallback() { }
- virtual bool handleEvent(AudioBuffer*) = 0;
+ enum InternalFieldIndex {
+ InternalStateIndex,
+ InternalResultIndex,
+ InternalFulfillCallbackIndex,
+ InternalRejectCallbackIndex,
+ InternalFieldCount, // This entry must always be at the bottom.
+ };
+
+ enum PromiseStatus {
+ Pending,
+ Fulfilled,
+ Rejected,
+ };
};
-} // namespace
-
-#endif // ENABLE(WEB_AUDIO)
+} // namespace WebCore
-#endif // AudioBufferCallback_h
+#endif // V8PromiseCustom_h

Powered by Google App Engine
This is Rietveld 408576698