Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: Source/bindings/modules/v8/ToV8ForModules.h

Issue 972153002: [bindings] Remove custom binding usage in SQLResultSetRowList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@test
Patch Set: Patch for landing Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/modules/v8/ToV8ForModules.h
diff --git a/Source/bindings/modules/v8/ToV8ForModules.h b/Source/bindings/modules/v8/ToV8ForModules.h
new file mode 100644
index 0000000000000000000000000000000000000000..6580f0f5bbd99af221672148be18b01d253f81b5
--- /dev/null
+++ b/Source/bindings/modules/v8/ToV8ForModules.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 ToV8ForModules_h
+#define ToV8ForModules_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 // ToV8ForModules_h
+
« no previous file with comments | « Source/bindings/core/v8/ToV8Test.cpp ('k') | Source/bindings/modules/v8/custom/V8SQLResultSetRowListCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698