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

Unified Diff: Source/bindings/v8/ScriptPromise.h

Issue 23479016: Introduce Promise mapping to the IDL generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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/ScriptPromise.h
diff --git a/Source/bindings/v8/ScriptString.h b/Source/bindings/v8/ScriptPromise.h
similarity index 72%
copy from Source/bindings/v8/ScriptString.h
copy to Source/bindings/v8/ScriptPromise.h
index 14467c7eb9feb0e4c7780ef86d013820b5f2174f..203c1f53aba6749af2d64f879a40bcd41678a913 100644
--- a/Source/bindings/v8/ScriptString.h
+++ b/Source/bindings/v8/ScriptPromise.h
@@ -28,24 +28,42 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptString_h
-#define ScriptString_h
+#ifndef ScriptPromise_h
+#define ScriptPromise_h
+#include "bindings/v8/ScopedPersistent.h"
#include "bindings/v8/ScriptValue.h"
-#include "bindings/v8/V8Binding.h"
-#include "wtf/text/WTFString.h"
+#include "bindings/v8/V8ScriptRunner.h"
+#include <v8.h>
namespace WebCore {
-class ScriptString : public ScriptValue {
+class ScriptPromise : public ScriptValue {
public:
- ScriptString() { }
- explicit ScriptString(v8::Handle<v8::String> value) : ScriptValue(value) { }
+ ScriptPromise()
+ : ScriptValue()
+ {
+ }
- ScriptString concatenateWith(const String&);
- String flattenToString() const;
+ explicit ScriptPromise(ScriptValue promise)
+ : ScriptValue(promise)
+ {
+ ASSERT(!hasNoValue());
+ }
+
+ explicit ScriptPromise(v8::Handle<v8::Value> promise)
+ : ScriptValue(promise)
+ {
+ ASSERT(!hasNoValue());
+ }
+
+ bool isUndefinedOrNull() const
+ {
+ return isUndefined() || isNull();
+ }
};
} // namespace WebCore
-#endif // ScriptString_h
+
+#endif // ScriptPromise_h

Powered by Google App Engine
This is Rietveld 408576698