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

Unified Diff: Source/bindings/modules/v8/V8BindingForModules.cpp

Issue 949193002: [bindings] Remove SQLTransaction's usage of custom binding. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Introducing V8BindingForModules 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/V8BindingForModules.cpp
diff --git a/Source/bindings/modules/v8/V8BindingForModules.cpp b/Source/bindings/modules/v8/V8BindingForModules.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3fef7fe0fe3201ccb199506895081ecbe66d60ac
--- /dev/null
+++ b/Source/bindings/modules/v8/V8BindingForModules.cpp
@@ -0,0 +1,34 @@
+// 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.
+
+#include "config.h"
+#include "bindings/modules/v8/V8BindingForModules.h"
+
+#include "bindings/core/v8/V8Binding.h"
+#include "modules/webdatabase/sqlite/SQLValue.h"
+
+namespace blink {
+
+Vector<SQLValue> toSQLValueArray(const Nullable<Vector<ScriptValue>>& values)
Jens Widell 2015/03/05 13:54:37 I think toSQLValueArray(const Vector<ScriptValue>>
bashi 2015/03/06 00:52:58 We might want to have more generic one like follow
+{
+ if (values.isNull())
+ return Vector<SQLValue>();
+
+ Vector<SQLValue> sqlValues;
+ const Vector<ScriptValue>& arguments = values.get();
+ for (unsigned i = 0; i < arguments.size(); ++i) {
+ const v8::Local<v8::Value>& arg = arguments[i].v8Value();
+ if (arg.IsEmpty() || arg->IsNull()) {
+ sqlValues.append(SQLValue());
+ } else if (arg->IsNumber()) {
+ sqlValues.append(SQLValue(arg->NumberValue()));
+ } else {
+ TOSTRING_DEFAULT(V8StringResource<>, stringValue, arg, Vector<SQLValue>());
Jens Widell 2015/03/05 13:54:38 Exception handling is wrong here. This function sh
+ sqlValues.append(SQLValue(stringValue));
+ }
+ }
+ return sqlValues;
+}
+
+} // namespace blink
« no previous file with comments | « Source/bindings/modules/v8/V8BindingForModules.h ('k') | Source/bindings/modules/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698