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

Side by Side Diff: Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp

Issue 10660025: Cleanup dart to string conversions. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: . Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011, Google Inc. 1 // Copyright 2011, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 { 38 {
39 if (Dart_IsNumber(handle)) { 39 if (Dart_IsNumber(handle)) {
40 // FIXME: NaN support. 40 // FIXME: NaN support.
41 double asDouble = DartUtilities::dartToDouble(handle, exception); 41 double asDouble = DartUtilities::dartToDouble(handle, exception);
42 if (exception) 42 if (exception)
43 return 0; 43 return 0;
44 return IDBKey::createNumber(asDouble); 44 return IDBKey::createNumber(asDouble);
45 } 45 }
46 46
47 if (Dart_IsString(handle)) { 47 if (Dart_IsString(handle)) {
48 RefPtr<StringImpl> asStringImpl = DartUtilities::toStringImpl(handle, Da rtUtilities::ConvertNone, exception); 48 DartStringAdapter asString = DartUtilities::dartToString(handle, excepti on);
49 if (exception) 49 if (exception)
50 return 0; 50 return 0;
51 return IDBKey::createString(asStringImpl); 51 return IDBKey::createString(asString);
52 } 52 }
53 53
54 // FIXME: Support Date case. 54 // FIXME: Support Date case.
55 55
56 if (Dart_IsList(handle)) { 56 if (Dart_IsList(handle)) {
57 // FIXME: Support Array case. 57 // FIXME: Support Array case.
58 exception = DART_UNIMPLEMENTED_EXCEPTION(); 58 exception = DART_UNIMPLEMENTED_EXCEPTION();
59 return 0; 59 return 0;
60 } 60 }
61 61
(...skipping 22 matching lines...) Expand all
84 return Dart_Null(); 84 return Dart_Null();
85 } 85 }
86 86
87 ASSERT_NOT_REACHED(); 87 ASSERT_NOT_REACHED();
88 return Dart_Null(); 88 return Dart_Null();
89 } 89 }
90 90
91 } 91 }
92 92
93 #endif // ENABLE(INDEXED_DATABASE) 93 #endif // ENABLE(INDEXED_DATABASE)
OLDNEW
« no previous file with comments | « Source/WebCore/bindings/dart/custom/DartHistoryCustom.cpp ('k') | Source/WebCore/bindings/dart/custom/DartIntentCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698