OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8BindingForModules_h | 5 #ifndef V8BindingForModules_h |
6 #define V8BindingForModules_h | 6 #define V8BindingForModules_h |
7 | 7 |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "modules/indexeddb/IDBKeyPath.h" | |
9 #include "modules/webdatabase/sqlite/SQLValue.h" | 10 #include "modules/webdatabase/sqlite/SQLValue.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class IDBAny; | 14 class IDBAny; |
14 class IDBKey; | 15 class IDBKey; |
15 class IDBKeyPath; | |
16 class IDBKeyRange; | 16 class IDBKeyRange; |
17 class SerializedScriptValue; | 17 class SerializedScriptValue; |
18 class SharedBuffer; | 18 class SharedBuffer; |
19 class WebBlobInfo; | 19 class WebBlobInfo; |
20 | 20 |
21 // Exposed for unit testing: | 21 // Exposed for unit testing: |
22 bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Local<v8::Value> key, v8::Local<v8 ::Value>, const IDBKeyPath&); | 22 bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Local<v8::Value> key, v8::Local<v8 ::Value>, const IDBKeyPath&); |
23 | 23 |
24 // For use by Source/modules/indexeddb: | 24 // For use by Source/modules/indexeddb: |
25 IDBKey* createIDBKeyFromScriptValueAndKeyPath(v8::Isolate*, const ScriptValue&, const IDBKeyPath&); | |
26 bool canInjectIDBKeyIntoScriptValue(v8::Isolate*, const ScriptValue&, const IDBK eyPath&); | 25 bool canInjectIDBKeyIntoScriptValue(v8::Isolate*, const ScriptValue&, const IDBK eyPath&); |
27 ScriptValue deserializeScriptValue(ScriptState*, SerializedScriptValue*, const V ector<blink::WebBlobInfo>*); | 26 ScriptValue deserializeScriptValue(ScriptState*, SerializedScriptValue*, const V ector<blink::WebBlobInfo>*); |
28 | 27 |
29 #if ENABLE(ASSERT) | 28 #if ENABLE(ASSERT) |
30 void assertPrimaryKeyValidOrInjectable(ScriptState*, PassRefPtr<SharedBuffer>, c onst Vector<blink::WebBlobInfo>*, IDBKey*, const IDBKeyPath&); | 29 void assertPrimaryKeyValidOrInjectable(ScriptState*, PassRefPtr<SharedBuffer>, c onst Vector<blink::WebBlobInfo>*, IDBKey*, const IDBKeyPath&); |
31 #endif | 30 #endif |
32 | 31 |
33 template <> | 32 template <> |
34 struct NativeValueTraits<SQLValue> { | 33 struct NativeValueTraits<SQLValue> { |
35 static SQLValue nativeValue(v8::Local<v8::Value>, v8::Isolate*, ExceptionSta te&); | 34 static SQLValue nativeValue(v8::Local<v8::Value>, v8::Isolate*, ExceptionSta te&); |
36 }; | 35 }; |
37 | 36 |
38 template <> | 37 template <> |
39 struct NativeValueTraits<IDBKey*> { | 38 struct NativeValueTraits<IDBKey*> { |
40 static IDBKey* nativeValue(v8::Local<v8::Value>, v8::Isolate*, ExceptionStat e&); | 39 static IDBKey* nativeValue(v8::Local<v8::Value>, v8::Isolate*, ExceptionStat e&, const IDBKeyPath& = IDBKeyPath()); |
jsbell
2015/03/19 16:46:57
It's possible that creating a temporary IDBKeyPath
vivekg
2015/03/19 17:46:52
Sure, we can have the overloaded method for non ID
| |
41 }; | 40 }; |
42 | 41 |
43 template <> | 42 template <> |
44 struct NativeValueTraits<IDBKeyRange*> { | 43 struct NativeValueTraits<IDBKeyRange*> { |
45 static IDBKeyRange* nativeValue(v8::Local<v8::Value>, v8::Isolate*, Exceptio nState&); | 44 static IDBKeyRange* nativeValue(v8::Local<v8::Value>, v8::Isolate*, Exceptio nState&); |
46 }; | 45 }; |
47 | 46 |
48 } // namespace blink | 47 } // namespace blink |
49 | 48 |
50 #endif // V8BindingForModules_h | 49 #endif // V8BindingForModules_h |
OLD | NEW |