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

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

Issue 344423002: Remove useless function and typs in the V8Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « no previous file | Source/bindings/v8/V8Callback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | Source/bindings/v8/V8Callback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698