OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8BindingForModules_h |
| 6 #define V8BindingForModules_h |
| 7 |
| 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "modules/webdatabase/sqlite/SQLValue.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 template <> |
| 14 struct NativeValueTraits<SQLValue> { |
| 15 static SQLValue nativeValue(const v8::Local<v8::Value>& value, v8::Isolate*
isolate, ExceptionState& exceptionState) |
| 16 { |
| 17 if (value.IsEmpty() || value->IsNull()) |
| 18 return SQLValue(); |
| 19 if (value->IsNumber()) |
| 20 return SQLValue(value->NumberValue()); |
| 21 V8StringResource<> stringValue(value); |
| 22 if (!stringValue.prepare(exceptionState)) |
| 23 return SQLValue(); |
| 24 return SQLValue(stringValue); |
| 25 } |
| 26 }; |
| 27 |
| 28 } // namespace blink |
| 29 |
| 30 #endif // V8BindingForModules_h |
OLD | NEW |