| 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/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 | 17 |
| 18 inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | 18 inline v8::Local<v8::Value> toV8(const SQLValue& sqlValue, v8::Local<v8::Object>
creationContext, v8::Isolate* isolate) |
| 19 { | 19 { |
| 20 switch (sqlValue.type()) { | 20 switch (sqlValue.type()) { |
| 21 case SQLValue::NullValue: | 21 case SQLValue::NullValue: |
| 22 return v8::Null(isolate); | 22 return v8::Null(isolate); |
| 23 case SQLValue::NumberValue: | 23 case SQLValue::NumberValue: |
| 24 return v8::Number::New(isolate, sqlValue.number()); | 24 return v8::Number::New(isolate, sqlValue.number()); |
| 25 case SQLValue::StringValue: | 25 case SQLValue::StringValue: |
| 26 return v8String(isolate, sqlValue.string()); | 26 return v8String(isolate, sqlValue.string()); |
| 27 } | 27 } |
| 28 ASSERT_NOT_REACHED(); | 28 ASSERT_NOT_REACHED(); |
| 29 return v8::Local<v8::Value>(); | 29 return v8::Local<v8::Value>(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 v8::Local<v8::Value> toV8(const IDBKeyPath&, v8::Local<v8::Object> creationConte
xt, v8::Isolate*); | 32 v8::Local<v8::Value> toV8(const IDBKeyPath&, v8::Local<v8::Object> creationConte
xt, v8::Isolate*); |
| 33 MODULES_EXPORT v8::Local<v8::Value> toV8(const IDBKey*, v8::Local<v8::Object> cr
eationContext, v8::Isolate*); | 33 MODULES_EXPORT v8::Local<v8::Value> toV8(const IDBKey*, v8::Local<v8::Object> cr
eationContext, v8::Isolate*); |
| 34 v8::Local<v8::Value> toV8(const IDBAny*, v8::Local<v8::Object> creationContext,
v8::Isolate*); | 34 v8::Local<v8::Value> toV8(const IDBAny*, v8::Local<v8::Object> creationContext,
v8::Isolate*); |
| 35 | 35 |
| 36 } // namespace blink | 36 } // namespace blink |
| 37 | 37 |
| 38 #endif // ToV8ForModules_h | 38 #endif // ToV8ForModules_h |
| 39 | 39 |
| OLD | NEW |