| OLD | NEW |
| 1 library dart.dom.indexed_db; | 1 library dart.dom.indexed_db; |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 import 'dart:html_common'; | 5 import 'dart:html_common'; |
| 6 import 'dart:nativewrappers'; | 6 import 'dart:nativewrappers'; |
| 7 import 'dart:_blink' as _blink; | 7 import 'dart:_blink' as _blink; |
| 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9 // for details. All rights reserved. Use of this source code is governed by a | 9 // for details. All rights reserved. Use of this source code is governed by a |
| 10 // BSD-style license that can be found in the LICENSE file. | 10 // BSD-style license that can be found in the LICENSE file. |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 if (key != null) { | 467 if (key != null) { |
| 468 if (range != null) { | 468 if (range != null) { |
| 469 throw new ArgumentError('Cannot specify both key and range.'); | 469 throw new ArgumentError('Cannot specify both key and range.'); |
| 470 } | 470 } |
| 471 key_OR_range = key; | 471 key_OR_range = key; |
| 472 } else { | 472 } else { |
| 473 key_OR_range = range; | 473 key_OR_range = range; |
| 474 } | 474 } |
| 475 var request; | 475 var request; |
| 476 if (direction == null) { | 476 if (direction == null) { |
| 477 request = _openCursor(key_OR_range); | 477 // FIXME: Passing in "next" should be unnecessary. |
| 478 request = _openCursor(key_OR_range, "next"); |
| 478 } else { | 479 } else { |
| 479 request = _openCursor(key_OR_range, direction); | 480 request = _openCursor(key_OR_range, direction); |
| 480 } | 481 } |
| 481 return ObjectStore._cursorStreamFromResult(request, autoAdvance); | 482 return ObjectStore._cursorStreamFromResult(request, autoAdvance); |
| 482 } | 483 } |
| 483 | 484 |
| 484 /** | 485 /** |
| 485 * Creates a stream of cursors over the records in this object store. | 486 * Creates a stream of cursors over the records in this object store. |
| 486 * | 487 * |
| 487 * See also: | 488 * See also: |
| 488 * | 489 * |
| 489 * * [ObjectStore.openCursor] | 490 * * [ObjectStore.openCursor] |
| 490 */ | 491 */ |
| 491 Stream<Cursor> openKeyCursor({key, KeyRange range, String direction, | 492 Stream<Cursor> openKeyCursor({key, KeyRange range, String direction, |
| 492 bool autoAdvance}) { | 493 bool autoAdvance}) { |
| 493 var key_OR_range = null; | 494 var key_OR_range = null; |
| 494 if (key != null) { | 495 if (key != null) { |
| 495 if (range != null) { | 496 if (range != null) { |
| 496 throw new ArgumentError('Cannot specify both key and range.'); | 497 throw new ArgumentError('Cannot specify both key and range.'); |
| 497 } | 498 } |
| 498 key_OR_range = key; | 499 key_OR_range = key; |
| 499 } else { | 500 } else { |
| 500 key_OR_range = range; | 501 key_OR_range = range; |
| 501 } | 502 } |
| 502 var request; | 503 var request; |
| 503 if (direction == null) { | 504 if (direction == null) { |
| 504 request = _openKeyCursor(key_OR_range); | 505 // FIXME: Passing in "next" should be unnecessary. |
| 506 request = _openKeyCursor(key_OR_range, "next"); |
| 505 } else { | 507 } else { |
| 506 request = _openKeyCursor(key_OR_range, direction); | 508 request = _openKeyCursor(key_OR_range, direction); |
| 507 } | 509 } |
| 508 return ObjectStore._cursorStreamFromResult(request, autoAdvance); | 510 return ObjectStore._cursorStreamFromResult(request, autoAdvance); |
| 509 } | 511 } |
| 510 | 512 |
| 511 // To suppress missing implicit constructor warnings. | 513 // To suppress missing implicit constructor warnings. |
| 512 factory Index._() { throw new UnsupportedError("Not supported"); } | 514 factory Index._() { throw new UnsupportedError("Not supported"); } |
| 513 | 515 |
| 514 @DomName('IDBIndex.keyPath') | 516 @DomName('IDBIndex.keyPath') |
| (...skipping 23 matching lines...) Expand all Loading... |
| 538 @DomName('IDBIndex.get') | 540 @DomName('IDBIndex.get') |
| 539 @DocsEditable() | 541 @DocsEditable() |
| 540 Request _get(Object key) => _blink.BlinkIDBIndex.get_Callback_ScriptValue(this
, key); | 542 Request _get(Object key) => _blink.BlinkIDBIndex.get_Callback_ScriptValue(this
, key); |
| 541 | 543 |
| 542 @DomName('IDBIndex.getKey') | 544 @DomName('IDBIndex.getKey') |
| 543 @DocsEditable() | 545 @DocsEditable() |
| 544 Request _getKey(Object key) => _blink.BlinkIDBIndex.getKey_Callback_ScriptValu
e(this, key); | 546 Request _getKey(Object key) => _blink.BlinkIDBIndex.getKey_Callback_ScriptValu
e(this, key); |
| 545 | 547 |
| 546 @DomName('IDBIndex.openCursor') | 548 @DomName('IDBIndex.openCursor') |
| 547 @DocsEditable() | 549 @DocsEditable() |
| 548 Request _openCursor(Object key, [String direction]) => _blink.BlinkIDBIndex.op
enCursor_Callback_ScriptValue_DOMString(this, key, direction); | 550 Request _openCursor(Object range, String direction) => _blink.BlinkIDBIndex.op
enCursor_Callback_ScriptValue_DOMString(this, range, direction); |
| 549 | 551 |
| 550 @DomName('IDBIndex.openKeyCursor') | 552 @DomName('IDBIndex.openKeyCursor') |
| 551 @DocsEditable() | 553 @DocsEditable() |
| 552 Request _openKeyCursor(Object key, [String direction]) => _blink.BlinkIDBIndex
.openKeyCursor_Callback_ScriptValue_DOMString(this, key, direction); | 554 Request _openKeyCursor(Object range, String direction) => _blink.BlinkIDBIndex
.openKeyCursor_Callback_ScriptValue_DOMString(this, range, direction); |
| 553 | 555 |
| 554 } | 556 } |
| 555 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 557 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 556 // for details. All rights reserved. Use of this source code is governed by a | 558 // for details. All rights reserved. Use of this source code is governed by a |
| 557 // BSD-style license that can be found in the LICENSE file. | 559 // BSD-style license that can be found in the LICENSE file. |
| 558 | 560 |
| 559 | 561 |
| 560 @DomName('IDBKeyRange') | 562 @DomName('IDBKeyRange') |
| 561 @Unstable() | 563 @Unstable() |
| 562 class KeyRange extends NativeFieldWrapperClass2 { | 564 class KeyRange extends NativeFieldWrapperClass2 { |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 | 1099 |
| 1098 @DomName('IDBVersionChangeEvent.newVersion') | 1100 @DomName('IDBVersionChangeEvent.newVersion') |
| 1099 @DocsEditable() | 1101 @DocsEditable() |
| 1100 int get newVersion => _blink.BlinkIDBVersionChangeEvent.newVersion_Getter(this
); | 1102 int get newVersion => _blink.BlinkIDBVersionChangeEvent.newVersion_Getter(this
); |
| 1101 | 1103 |
| 1102 @DomName('IDBVersionChangeEvent.oldVersion') | 1104 @DomName('IDBVersionChangeEvent.oldVersion') |
| 1103 @DocsEditable() | 1105 @DocsEditable() |
| 1104 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.oldVersion_Getter(this
); | 1106 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.oldVersion_Getter(this
); |
| 1105 | 1107 |
| 1106 } | 1108 } |
| OLD | NEW |