Chromium Code Reviews| Index: Source/bindings/modules/v8/ToV8.h |
| diff --git a/Source/bindings/modules/v8/ToV8.h b/Source/bindings/modules/v8/ToV8.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..901371af5d6856dc099c107c0e96a9da9365f609 |
| --- /dev/null |
| +++ b/Source/bindings/modules/v8/ToV8.h |
| @@ -0,0 +1,32 @@ |
| +// 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 BINDINGS_MODULES_V8_ToV8_h |
|
vivekg
2015/03/04 13:34:04
Presubmit throws an error here:
Source/bindings/m
Yuki
2015/03/04 14:11:04
I personally think the style guide is wrong. As w
|
| +#define BINDINGS_MODULES_V8_ToV8_h |
| + |
| +#include "bindings/core/v8/V8Binding.h" |
| +#include "modules/webdatabase/sqlite/SQLValue.h" |
| + |
| +#include <v8.h> |
| + |
| +namespace blink { |
| + |
| +inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Isolate* isolate) |
|
Yuki
2015/03/04 14:11:04
The signature of toV8() functions must be
v8::Ha
|
| +{ |
| + 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 // BINDINGS_MODULES_V8_ToV8_h |
| + |