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/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "modules/webdatabase/sqlite/SQLValue.h" | 10 #include "modules/webdatabase/sqlite/SQLValue.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class IDBAny; | 14 class IDBAny; |
15 class IDBKey; | 15 class IDBKey; |
16 class IDBKeyPath; | 16 class IDBKeyPath; |
17 class IDBKeyRange; | 17 class IDBKeyRange; |
18 class IDBValue; | 18 class IDBValue; |
19 class SerializedScriptValue; | 19 class SerializedScriptValue; |
20 class SharedBuffer; | 20 class SharedBuffer; |
21 class WebBlobInfo; | 21 class WebBlobInfo; |
22 | 22 |
23 // Exposed for unit testing: | 23 // Exposed for unit testing: |
24 MODULES_EXPORT bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Local<v8::Value> ke
y, v8::Local<v8::Value>, const IDBKeyPath&); | 24 MODULES_EXPORT bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Local<v8::Value> ke
y, v8::Local<v8::Value>, const IDBKeyPath&); |
25 | 25 |
26 // For use by Source/modules/indexeddb (and unit testing): | 26 // For use by Source/modules/indexeddb (and unit testing): |
27 MODULES_EXPORT bool canInjectIDBKeyIntoScriptValue(v8::Isolate*, const ScriptVal
ue&, const IDBKeyPath&); | 27 MODULES_EXPORT bool canInjectIDBKeyIntoScriptValue(v8::Isolate*, const ScriptVal
ue&, const IDBKeyPath&); |
28 ScriptValue deserializeScriptValue(ScriptState*, SerializedScriptValue*, const V
ector<blink::WebBlobInfo>*); | 28 ScriptValue deserializeScriptValue(ScriptState*, SerializedScriptValue*, const V
ector<WebBlobInfo>*); |
29 | 29 |
30 #if ENABLE(ASSERT) | 30 #if ENABLE(ASSERT) |
31 void assertPrimaryKeyValidOrInjectable(ScriptState*, const IDBValue*); | 31 void assertPrimaryKeyValidOrInjectable(ScriptState*, const IDBValue*); |
32 #endif | 32 #endif |
33 | 33 |
34 template <> | 34 template <> |
35 struct NativeValueTraits<SQLValue> { | 35 struct NativeValueTraits<SQLValue> { |
36 static SQLValue nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionSta
te&); | 36 static SQLValue nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionSta
te&); |
37 }; | 37 }; |
38 | 38 |
39 template <> | 39 template <> |
40 struct NativeValueTraits<IDBKey*> { | 40 struct NativeValueTraits<IDBKey*> { |
41 static IDBKey* nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionStat
e&); | 41 static IDBKey* nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionStat
e&); |
42 MODULES_EXPORT static IDBKey* nativeValue(v8::Isolate*, v8::Local<v8::Value>
, ExceptionState&, const IDBKeyPath&); | 42 MODULES_EXPORT static IDBKey* nativeValue(v8::Isolate*, v8::Local<v8::Value>
, ExceptionState&, const IDBKeyPath&); |
43 }; | 43 }; |
44 | 44 |
45 template <> | 45 template <> |
46 struct NativeValueTraits<IDBKeyRange*> { | 46 struct NativeValueTraits<IDBKeyRange*> { |
47 static IDBKeyRange* nativeValue(v8::Isolate*, v8::Local<v8::Value>, Exceptio
nState&); | 47 static IDBKeyRange* nativeValue(v8::Isolate*, v8::Local<v8::Value>, Exceptio
nState&); |
48 }; | 48 }; |
49 | 49 |
50 } // namespace blink | 50 } // namespace blink |
51 | 51 |
52 #endif // V8BindingForModules_h | 52 #endif // V8BindingForModules_h |
OLD | NEW |