Index: Source/bindings/modules/v8/V8BindingForModules.h |
diff --git a/Source/bindings/modules/v8/V8BindingForModules.h b/Source/bindings/modules/v8/V8BindingForModules.h |
index 72eedf5a3a5ce476bd981a86a0c68203d8680a39..c40a4b97f3e9b5c91a378e2bb070baf3abc75fc9 100644 |
--- a/Source/bindings/modules/v8/V8BindingForModules.h |
+++ b/Source/bindings/modules/v8/V8BindingForModules.h |
@@ -10,19 +10,39 @@ |
namespace blink { |
+class IDBAny; |
+class IDBKey; |
+class IDBKeyPath; |
+class IDBKeyRange; |
+class SerializedScriptValue; |
+class SharedBuffer; |
+class WebBlobInfo; |
+ |
+// Exposed for unit testing: |
+bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Local<v8::Value> key, v8::Local<v8::Value>, const IDBKeyPath&); |
+ |
+// For use by Source/modules/indexeddb: |
+IDBKey* createIDBKeyFromScriptValueAndKeyPath(v8::Isolate*, const ScriptValue&, const IDBKeyPath&); |
+bool canInjectIDBKeyIntoScriptValue(v8::Isolate*, const ScriptValue&, const IDBKeyPath&); |
+ScriptValue deserializeScriptValue(ScriptState*, SerializedScriptValue*, const Vector<blink::WebBlobInfo>*); |
+ |
+#if ENABLE(ASSERT) |
+void assertPrimaryKeyValidOrInjectable(ScriptState*, PassRefPtr<SharedBuffer>, const Vector<blink::WebBlobInfo>*, IDBKey*, const IDBKeyPath&); |
+#endif |
+ |
template <> |
struct NativeValueTraits<SQLValue> { |
- static SQLValue nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) |
- { |
- if (value.IsEmpty() || value->IsNull()) |
- return SQLValue(); |
- if (value->IsNumber()) |
- return SQLValue(value->NumberValue()); |
- V8StringResource<> stringValue(value); |
- if (!stringValue.prepare(exceptionState)) |
- return SQLValue(); |
- return SQLValue(stringValue); |
- } |
+ static SQLValue nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&); |
+}; |
+ |
+template <> |
+struct NativeValueTraits<IDBKey*> { |
+ static IDBKey* nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&); |
+}; |
+ |
+template <> |
+struct NativeValueTraits<IDBKeyRange*> { |
+ static IDBKeyRange* nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&); |
}; |
} // namespace blink |