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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
(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 #include "config.h"
6 #include "bindings/modules/v8/V8BindingForModules.h"
7
8 #include "bindings/core/v8/V8Binding.h"
9 #include "modules/webdatabase/sqlite/SQLValue.h"
10
11 namespace blink {
12
13 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
14 {
15 if (values.isNull())
16 return Vector<SQLValue>();
17
18 Vector<SQLValue> sqlValues;
19 const Vector<ScriptValue>& arguments = values.get();
20 for (unsigned i = 0; i < arguments.size(); ++i) {
21 const v8::Local<v8::Value>& arg = arguments[i].v8Value();
22 if (arg.IsEmpty() || arg->IsNull()) {
23 sqlValues.append(SQLValue());
24 } else if (arg->IsNumber()) {
25 sqlValues.append(SQLValue(arg->NumberValue()));
26 } else {
27 TOSTRING_DEFAULT(V8StringResource<>, stringValue, arg, Vector<SQLVal ue>());
Jens Widell 2015/03/05 13:54:38 Exception handling is wrong here. This function sh
28 sqlValues.append(SQLValue(stringValue));
29 }
30 }
31 return sqlValues;
32 }
33
34 } // namespace blink
OLDNEW
« 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