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

Side by Side Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Issue 11620004: Removed READ_ONLY constants from IDBTransaction class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 library indexed_db; 1 library indexed_db;
2 2
3 import 'dart:html'; 3 import 'dart:html';
4 import 'dart:html_common'; 4 import 'dart:html_common';
5 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 5 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6 // for details. All rights reserved. Use of this source code is governed by a 6 // for details. All rights reserved. Use of this source code is governed by a
7 // BSD-style license that can be found in the LICENSE file. 7 // BSD-style license that can be found in the LICENSE file.
8 8
9 // DO NOT EDIT 9 // DO NOT EDIT
10 // Auto-generated dart:svg library. 10 // Auto-generated dart:svg library.
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // and copy to JavaScript array if necessary. 206 // and copy to JavaScript array if necessary.
207 207
208 if (_transaction_fn != null) { 208 if (_transaction_fn != null) {
209 return _transaction_fn(this, storeName_OR_storeNames, mode); 209 return _transaction_fn(this, storeName_OR_storeNames, mode);
210 } 210 }
211 211
212 // Try and create a transaction with a string mode. Browsers that expect a 212 // Try and create a transaction with a string mode. Browsers that expect a
213 // numeric mode tend to convert the string into a number. This fails 213 // numeric mode tend to convert the string into a number. This fails
214 // silently, resulting in zero ('readonly'). 214 // silently, resulting in zero ('readonly').
215 var txn = _transaction(storeName_OR_storeNames, mode); 215 var txn = _transaction(storeName_OR_storeNames, mode);
216 if (_hasNumericMode(txn)) { 216 _transaction_fn = _transaction_string_mode;
217 _transaction_fn = _transaction_numeric_mode;
218 txn = _transaction_fn(this, storeName_OR_storeNames, mode);
219 } else {
220 _transaction_fn = _transaction_string_mode;
221 }
222 return txn; 217 return txn;
223 } 218 }
224 219
225 static Transaction _transaction_string_mode(Database db, stores, mode) { 220 static Transaction _transaction_string_mode(Database db, stores, mode) {
226 return db._transaction(stores, mode); 221 return db._transaction(stores, mode);
227 } 222 }
228 223
229 static Transaction _transaction_numeric_mode(Database db, stores, mode) {
230 int intMode;
231 if (mode == 'readonly') intMode = Transaction.READ_ONLY;
232 if (mode == 'readwrite') intMode = Transaction.READ_WRITE;
233 return db._transaction(stores, intMode);
234 }
235
236 @JSName('transaction') 224 @JSName('transaction')
237 Transaction _transaction(stores, mode) native; 225 Transaction _transaction(stores, mode) native;
238 226
239 static bool _hasNumericMode(txn) => 227 static bool _hasNumericMode(txn) =>
240 JS('bool', 'typeof(#.mode) === "number"', txn); 228 JS('bool', 'typeof(#.mode) === "number"', txn);
241 229
242 230
243 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 231 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
244 DatabaseEvents get on => 232 DatabaseEvents get on =>
245 new DatabaseEvents(this); 233 new DatabaseEvents(this);
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 EventListenerList get blocked => this['blocked']; 1027 EventListenerList get blocked => this['blocked'];
1040 } 1028 }
1041 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1029 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1042 // for details. All rights reserved. Use of this source code is governed by a 1030 // for details. All rights reserved. Use of this source code is governed by a
1043 // BSD-style license that can be found in the LICENSE file. 1031 // BSD-style license that can be found in the LICENSE file.
1044 1032
1045 1033
1046 /// @domName IDBAny; @docsEditable true 1034 /// @domName IDBAny; @docsEditable true
1047 class _Any native "*IDBAny" { 1035 class _Any native "*IDBAny" {
1048 } 1036 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698