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

Unified Diff: tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate

Issue 1473443003: Switch IDB Database.transaction to use a template to do the right type conversions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate b/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
index c89c29afb3fb8cffc6a7a5b139485624724373a6..8a74ad329f59974ad4963c7934f2ed06ffdff33a 100644
--- a/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
@@ -53,7 +53,7 @@ $if DART2JS
List storeNames_1 = convertDartToNative_StringArray(storeNames);
return _transaction(storeNames_1, mode);
}
-
+
Transaction transactionStores(DomStringList storeNames, String mode) {
if (mode != 'readonly' && mode != 'readwrite') {
throw new ArgumentError(mode);
@@ -63,6 +63,28 @@ $if DART2JS
@JSName('transaction')
Transaction _transaction(stores, mode) native;
+$else
+ Transaction transaction(storeName_OR_storeNames, String mode) {
+ if (mode != 'readonly' && mode != 'readwrite') {
+ throw new ArgumentError("Invalid transaction mode $mode");
+ }
+ var names;
+ if (storeName_OR_storeNames == null) {
+ throw new ArgumentError("stores may not be null in transaction");
+ } else if (storeName_OR_storeNames is String || storeName_OR_storeNames is DomStringList) {
+ names = unwrap_jso(storeName_OR_storeNames);
+ } else if (storeName_OR_storeNames is List<String>) {
+ names = convertDartToNative_List(storeName_OR_storeNames);
+ } else {
+ throw new ArgumentError("Invalid store(s) $store_Name_OR_storeNames");
+ }
+
+ return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), names, mode));
+ }
+
+ Transaction transactionList(List<String> storeNames, String mode) => transaction(storeNames, mode);
+ Transaction transactionStores(List<String> storeNames, String mode) => transaction(storeNames, mode);
+ Transaction transactionStore(String storeName, String mode) => transaction(storeName, mode);
$endif
$!MEMBERS}
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698