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

Side by Side 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 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
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 @DocsEditable() 7 @DocsEditable()
8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { 8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
9 @DomName('IDBDatabase.createObjectStore') 9 @DomName('IDBDatabase.createObjectStore')
10 @DocsEditable() 10 @DocsEditable()
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return _transaction(storeName, mode); 46 return _transaction(storeName, mode);
47 } 47 }
48 48
49 Transaction transactionList(List<String> storeNames, String mode) { 49 Transaction transactionList(List<String> storeNames, String mode) {
50 if (mode != 'readonly' && mode != 'readwrite') { 50 if (mode != 'readonly' && mode != 'readwrite') {
51 throw new ArgumentError(mode); 51 throw new ArgumentError(mode);
52 } 52 }
53 List storeNames_1 = convertDartToNative_StringArray(storeNames); 53 List storeNames_1 = convertDartToNative_StringArray(storeNames);
54 return _transaction(storeNames_1, mode); 54 return _transaction(storeNames_1, mode);
55 } 55 }
56 56
57 Transaction transactionStores(DomStringList storeNames, String mode) { 57 Transaction transactionStores(DomStringList storeNames, String mode) {
58 if (mode != 'readonly' && mode != 'readwrite') { 58 if (mode != 'readonly' && mode != 'readwrite') {
59 throw new ArgumentError(mode); 59 throw new ArgumentError(mode);
60 } 60 }
61 return _transaction(storeNames, mode); 61 return _transaction(storeNames, mode);
62 } 62 }
63 63
64 @JSName('transaction') 64 @JSName('transaction')
65 Transaction _transaction(stores, mode) native; 65 Transaction _transaction(stores, mode) native;
66 $else
67 Transaction transaction(storeName_OR_storeNames, String mode) {
68 if (mode != 'readonly' && mode != 'readwrite') {
69 throw new ArgumentError("Invalid transaction mode $mode");
70 }
71 var names;
72 if (storeName_OR_storeNames == null) {
73 throw new ArgumentError("stores may not be null in transaction");
74 } else if (storeName_OR_storeNames is String || storeName_OR_storeNames is D omStringList) {
75 names = unwrap_jso(storeName_OR_storeNames);
76 } else if (storeName_OR_storeNames is List<String>) {
77 names = convertDartToNative_List(storeName_OR_storeNames);
78 } else {
79 throw new ArgumentError("Invalid store(s) $store_Name_OR_storeNames");
80 }
81
82 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unw rap_jso(this), names, mode));
83 }
84
85 Transaction transactionList(List<String> storeNames, String mode) => transacti on(storeNames, mode);
86 Transaction transactionStores(List<String> storeNames, String mode) => transac tion(storeNames, mode);
87 Transaction transactionStore(String storeName, String mode) => transaction(sto reName, mode);
66 $endif 88 $endif
67 89
68 $!MEMBERS} 90 $!MEMBERS}
OLDNEW
« 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