Index: Source/bindings/v8/ScriptPromise.h |
diff --git a/Source/bindings/v8/ScriptPromise.h b/Source/bindings/v8/ScriptPromise.h |
index 170eb8122712c7d362985d127c7785a12ff5e498..95a84ad0f63df4111e188556a08691005ab127e1 100644 |
--- a/Source/bindings/v8/ScriptPromise.h |
+++ b/Source/bindings/v8/ScriptPromise.h |
@@ -31,16 +31,18 @@ |
#ifndef ScriptPromise_h |
#define ScriptPromise_h |
-#include "bindings/v8/ScopedPersistent.h" |
-#include "bindings/v8/ScriptFunction.h" |
#include "bindings/v8/ScriptValue.h" |
-#include "bindings/v8/V8ScriptRunner.h" |
+#include "bindings/v8/V8ThrowException.h" |
#include "wtf/Forward.h" |
+#include "wtf/PassOwnPtr.h" |
+#include "wtf/text/WTFString.h" |
#include <v8.h> |
namespace WebCore { |
+class ExceptionState; |
class ExecutionContext; |
+class ScriptFunction; |
// ScriptPromise is the class for representing Promise values in C++ world. |
// ScriptPromise holds a Promise. |
@@ -97,6 +99,23 @@ public: |
// if |value| is not a Promise object, returns a Promise object |
// resolved with |value|. |
static ScriptPromise cast(const ScriptValue& /*value*/); |
+ static ScriptPromise cast(v8::Handle<v8::Value>, v8::Isolate*); |
+ |
+ static ScriptPromise reject(const ScriptValue&); |
+ static ScriptPromise reject(v8::Handle<v8::Value>, v8::Isolate*); |
+ |
+ // static functions each of which returns a ScriptPromise rejected with |
+ // the given error. |
+ // They coresspond to functions in V8Binding.h, such as throwError, |
+ // throwTypeError, etc. |
+ static ScriptPromise rejectWithError(V8ErrorType, const String&, v8::Isolate*); |
+ static ScriptPromise rejectWithError(v8::Handle<v8::Value>, v8::Isolate*); |
+ static ScriptPromise rejectWithTypeError(const String&, v8::Isolate*); |
+ static ScriptPromise rejectWithArityTypeErrorForMethod( |
+ const char* method, const char* type, unsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*); |
+ static ScriptPromise rejectWithArityTypeErrorForConstructor( |
+ const char* type, unsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*); |
+ static ScriptPromise rejectWithArityTypeError(ExceptionState&, unsigned expected, unsigned providedLeastNumMandatoryParams); |
private: |
ScriptValue m_promise; |