Index: Source/bindings/v8/V8Callback.h |
diff --git a/Source/bindings/v8/V8Callback.h b/Source/bindings/v8/V8Callback.h |
index f6126243f2729247d8bded4b40e717b34a619219..574eebc0d0a3b242d7ee4c0d529d07dec572da84 100644 |
--- a/Source/bindings/v8/V8Callback.h |
+++ b/Source/bindings/v8/V8Callback.h |
@@ -31,49 +31,15 @@ |
#ifndef V8Callback_h |
#define V8Callback_h |
-#include "bindings/v8/ExceptionState.h" |
#include "bindings/v8/V8Binding.h" |
-#include "core/dom/ExceptionCode.h" |
#include <v8.h> |
namespace WebCore { |
-class ExecutionContext; |
- |
// Returns false if the callback threw an exception, true otherwise. |
bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, int argc, v8::Handle<v8::Value> argv[]); |
bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, v8::Handle<v8::Value> thisValue, int argc, v8::Handle<v8::Value> argv[]); |
-// FIXME: This file is used only by V8GeolocationCustom.cpp. Remove the custom binding and this file. |
-enum CallbackAllowedValueFlag { |
- CallbackAllowUndefined = 1, |
- CallbackAllowNull = 1 << 1 |
-}; |
- |
-typedef unsigned CallbackAllowedValueFlags; |
- |
-// 'FunctionOnly' is assumed for the created callback. |
-template <typename V8CallbackType> |
-PassOwnPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, unsigned index, bool& succeeded, v8::Isolate* isolate, ExceptionState& exceptionState, CallbackAllowedValueFlags acceptedValues = 0) |
-{ |
- succeeded = true; |
- |
- if (value->IsUndefined() && (acceptedValues & CallbackAllowUndefined)) |
- return nullptr; |
- |
- if (value->IsNull() && (acceptedValues & CallbackAllowNull)) |
- return nullptr; |
- |
- if (!value->IsFunction()) { |
- succeeded = false; |
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::argumentNullOrIncorrectType(index, "Function")); |
- exceptionState.throwIfNeeded(); |
- return nullptr; |
- } |
- |
- return V8CallbackType::create(v8::Handle<v8::Function>::Cast(value), ScriptState::current(isolate)); |
-} |
- |
} // namespace WebCore |
#endif // V8Callback_h |