| Index: Source/bindings/modules/v8/ToV8Utilities.h
|
| diff --git a/Source/bindings/modules/v8/ToV8Utilities.h b/Source/bindings/modules/v8/ToV8Utilities.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9efd48b3cb303e4692f4d409bc87b18238688ba7
|
| --- /dev/null
|
| +++ b/Source/bindings/modules/v8/ToV8Utilities.h
|
| @@ -0,0 +1,30 @@
|
| +// Copyright (c) 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef ToV8Utilities_h
|
| +#define ToV8Utilities_h
|
| +
|
| +#include "bindings/core/v8/V8Binding.h"
|
| +#include "modules/webdatabase/sqlite/SQLValue.h"
|
| +
|
| +namespace blink {
|
| +
|
| +inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| +{
|
| + switch (sqlValue.type()) {
|
| + case SQLValue::NullValue:
|
| + return v8::Null(isolate);
|
| + case SQLValue::NumberValue:
|
| + return v8::Number::New(isolate, sqlValue.number());
|
| + case SQLValue::StringValue:
|
| + return v8String(isolate, sqlValue.string());
|
| + }
|
| + ASSERT_NOT_REACHED();
|
| + return v8::Local<v8::Value>();
|
| +}
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // ToV8Utilities_h
|
| +
|
|
|