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 ToV8ForModules_h | 5 #ifndef ToV8ForModules_h |
6 #define ToV8ForModules_h | 6 #define ToV8ForModules_h |
7 | 7 |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "modules/webdatabase/sqlite/SQLValue.h" | 9 #include "modules/webdatabase/sqlite/SQLValue.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
| 13 class IDBAny; |
| 14 class IDBKey; |
| 15 class IDBKeyPath; |
| 16 |
13 inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | 17 inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) |
14 { | 18 { |
15 switch (sqlValue.type()) { | 19 switch (sqlValue.type()) { |
16 case SQLValue::NullValue: | 20 case SQLValue::NullValue: |
17 return v8::Null(isolate); | 21 return v8::Null(isolate); |
18 case SQLValue::NumberValue: | 22 case SQLValue::NumberValue: |
19 return v8::Number::New(isolate, sqlValue.number()); | 23 return v8::Number::New(isolate, sqlValue.number()); |
20 case SQLValue::StringValue: | 24 case SQLValue::StringValue: |
21 return v8String(isolate, sqlValue.string()); | 25 return v8String(isolate, sqlValue.string()); |
22 } | 26 } |
23 ASSERT_NOT_REACHED(); | 27 ASSERT_NOT_REACHED(); |
24 return v8::Local<v8::Value>(); | 28 return v8::Local<v8::Value>(); |
25 } | 29 } |
26 | 30 |
| 31 v8::Local<v8::Value> toV8(const IDBKeyPath&, v8::Local<v8::Object> creationConte
xt, v8::Isolate*); |
| 32 v8::Local<v8::Value> toV8(const IDBKey*, v8::Local<v8::Object> creationContext,
v8::Isolate*); |
| 33 v8::Local<v8::Value> toV8(const IDBAny*, v8::Local<v8::Object> creationContext,
v8::Isolate*); |
| 34 |
27 } // namespace blink | 35 } // namespace blink |
28 | 36 |
29 #endif // ToV8ForModules_h | 37 #endif // ToV8ForModules_h |
30 | 38 |
OLD | NEW |