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

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

Issue 949193002: [bindings] Remove SQLTransaction's usage of custom binding. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed exception 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/modules/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/modules/v8/V8BindingForModules.h
diff --git a/Source/bindings/modules/v8/V8BindingForModules.h b/Source/bindings/modules/v8/V8BindingForModules.h
new file mode 100644
index 0000000000000000000000000000000000000000..72eedf5a3a5ce476bd981a86a0c68203d8680a39
--- /dev/null
+++ b/Source/bindings/modules/v8/V8BindingForModules.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 V8BindingForModules_h
+#define V8BindingForModules_h
+
+#include "bindings/core/v8/V8Binding.h"
+#include "modules/webdatabase/sqlite/SQLValue.h"
+
+namespace blink {
+
+template <>
+struct NativeValueTraits<SQLValue> {
+ static SQLValue nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
+ {
+ if (value.IsEmpty() || value->IsNull())
+ return SQLValue();
+ if (value->IsNumber())
+ return SQLValue(value->NumberValue());
+ V8StringResource<> stringValue(value);
+ if (!stringValue.prepare(exceptionState))
+ return SQLValue();
+ return SQLValue(stringValue);
+ }
+};
+
+} // namespace blink
+
+#endif // V8BindingForModules_h
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/modules/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698