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

Unified Diff: Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp

Issue 10173006: Partial support to IDBKey to Dart conversions. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp
diff --git a/Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp b/Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp
index ceb0a89ed2cd268acf0f15905c5ff3fe0b5559d8..5b19b397f7d0b16fc4aa31eb16e184bdc415c4f2 100644
--- a/Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp
+++ b/Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp
@@ -62,10 +62,30 @@ PassRefPtr<IDBKey> DartIDBKey::toNative(Dart_Handle handle, Dart_Handle& excepti
return IDBKey::createInvalid();
}
-Dart_Handle DartIDBKey::toDart(IDBKey*)
+Dart_Handle DartIDBKey::toDart(IDBKey* key)
{
- DART_UNIMPLEMENTED();
- return 0;
+ if (!key)
+ return Dart_Null();
+
+ switch (key->type()) {
+ case IDBKey::InvalidType:
+ case IDBKey::MinType:
+ ASSERT_NOT_REACHED();
+ return Dart_Null();
+ case IDBKey::NumberType:
+ return DartUtilities::doubleToDart(key->number());
+ case IDBKey::StringType:
+ return DartUtilities::stringToDart(key->string());
+ case IDBKey::DateType:
+ // FIXME: support Date.
+ return Dart_Null();
+ case IDBKey::ArrayType:
+ // FIXME: support Array.
+ return Dart_Null();
+ }
+
+ ASSERT_NOT_REACHED();
+ return Dart_Null();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698