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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11434079: Adding dart:indexed_db. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Syncing with latest. 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
« no previous file with comments | « sdk/lib/_internal/libraries.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:collection'; 3 import 'dart:collection';
4 import 'dart:html_common'; 4 import 'dart:html_common';
5 import 'dart:indexed_db';
5 import 'dart:isolate'; 6 import 'dart:isolate';
6 import 'dart:json'; 7 import 'dart:json';
7 import 'dart:svg' as svg; 8 import 'dart:svg' as svg;
8 import 'dart:web_audio' as web_audio; 9 import 'dart:web_audio' as web_audio;
9 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10 // for details. All rights reserved. Use of this source code is governed by a 11 // for details. All rights reserved. Use of this source code is governed by a
11 // BSD-style license that can be found in the LICENSE file. 12 // BSD-style license that can be found in the LICENSE file.
12 13
13 // DO NOT EDIT 14 // DO NOT EDIT
14 // Auto-generated dart:html library. 15 // Auto-generated dart:html library.
(...skipping 9603 matching lines...) Expand 10 before | Expand all | Expand 10 after
9618 9619
9619 EventListenerList get loadStart => this['loadstart']; 9620 EventListenerList get loadStart => this['loadstart'];
9620 9621
9621 EventListenerList get progress => this['progress']; 9622 EventListenerList get progress => this['progress'];
9622 } 9623 }
9623 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9624 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9624 // for details. All rights reserved. Use of this source code is governed by a 9625 // for details. All rights reserved. Use of this source code is governed by a
9625 // BSD-style license that can be found in the LICENSE file. 9626 // BSD-style license that can be found in the LICENSE file.
9626 9627
9627 9628
9628 /// @domName IDBAny; @docsEditable true
9629 class IDBAny native "*IDBAny" {
9630 }
9631 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9632 // for details. All rights reserved. Use of this source code is governed by a
9633 // BSD-style license that can be found in the LICENSE file.
9634
9635
9636 /// @domName IDBCursor; @docsEditable true
9637 class IDBCursor native "*IDBCursor" {
9638
9639 static const int NEXT = 0;
9640
9641 static const int NEXT_NO_DUPLICATE = 1;
9642
9643 static const int PREV = 2;
9644
9645 static const int PREV_NO_DUPLICATE = 3;
9646
9647 /// @domName IDBCursor.direction; @docsEditable true
9648 final String direction;
9649
9650 /// @domName IDBCursor.key; @docsEditable true
9651 @_annotation_Creates_IDBKey @_annotation_Returns_IDBKey
9652 final Object key;
9653
9654 /// @domName IDBCursor.primaryKey; @docsEditable true
9655 final Object primaryKey;
9656
9657 /// @domName IDBCursor.source; @docsEditable true
9658 final dynamic source;
9659
9660 /// @domName IDBCursor.advance; @docsEditable true
9661 void advance(int count) native;
9662
9663 /// @domName IDBCursor.continueFunction; @docsEditable true
9664 void continueFunction([/*IDBKey*/ key]) {
9665 if (?key) {
9666 var key_1 = _convertDartToNative_IDBKey(key);
9667 _continueFunction_1(key_1);
9668 return;
9669 }
9670 _continueFunction_2();
9671 return;
9672 }
9673 @JSName('continue')
9674 void _continueFunction_1(key) native;
9675 @JSName('continue')
9676 void _continueFunction_2() native;
9677
9678 /// @domName IDBCursor.delete; @docsEditable true
9679 IDBRequest delete() native;
9680
9681 /// @domName IDBCursor.update; @docsEditable true
9682 IDBRequest update(/*any*/ value) {
9683 var value_1 = convertDartToNative_SerializedScriptValue(value);
9684 return _update_1(value_1);
9685 }
9686 @JSName('update')
9687 IDBRequest _update_1(value) native;
9688 }
9689 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9690 // for details. All rights reserved. Use of this source code is governed by a
9691 // BSD-style license that can be found in the LICENSE file.
9692
9693
9694 /// @domName IDBCursorWithValue; @docsEditable true
9695 class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" {
9696
9697 /// @domName IDBCursorWithValue.value; @docsEditable true
9698 @annotation_Creates_SerializedScriptValue @annotation_Returns_SerializedScript Value
9699 final Object value;
9700 }
9701 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9702 // for details. All rights reserved. Use of this source code is governed by a
9703 // BSD-style license that can be found in the LICENSE file.
9704
9705
9706 /// @domName IDBDatabase
9707 class IDBDatabase extends EventTarget native "*IDBDatabase" {
9708
9709 IDBTransaction transaction(storeName_OR_storeNames, String mode) {
9710 if (mode != 'readonly' && mode != 'readwrite') {
9711 throw new ArgumentError(mode);
9712 }
9713
9714 // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
9715 // and copy to JavaScript array if necessary.
9716
9717 if (_transaction_fn != null) {
9718 return _transaction_fn(this, storeName_OR_storeNames, mode);
9719 }
9720
9721 // Try and create a transaction with a string mode. Browsers that expect a
9722 // numeric mode tend to convert the string into a number. This fails
9723 // silently, resulting in zero ('readonly').
9724 var txn = _transaction(storeName_OR_storeNames, mode);
9725 if (_hasNumericMode(txn)) {
9726 _transaction_fn = _transaction_numeric_mode;
9727 txn = _transaction_fn(this, storeName_OR_storeNames, mode);
9728 } else {
9729 _transaction_fn = _transaction_string_mode;
9730 }
9731 return txn;
9732 }
9733
9734 static IDBTransaction _transaction_string_mode(IDBDatabase db, stores, mode) {
9735 return db._transaction(stores, mode);
9736 }
9737
9738 static IDBTransaction _transaction_numeric_mode(IDBDatabase db, stores, mode) {
9739 int intMode;
9740 if (mode == 'readonly') intMode = IDBTransaction.READ_ONLY;
9741 if (mode == 'readwrite') intMode = IDBTransaction.READ_WRITE;
9742 return db._transaction(stores, intMode);
9743 }
9744
9745 @JSName('transaction')
9746 IDBTransaction _transaction(stores, mode) native;
9747
9748 static bool _hasNumericMode(txn) =>
9749 JS('bool', 'typeof(#.mode) === "number"', txn);
9750
9751
9752 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
9753 IDBDatabaseEvents get on =>
9754 new IDBDatabaseEvents(this);
9755
9756 /// @domName IDBDatabase.name; @docsEditable true
9757 final String name;
9758
9759 /// @domName IDBDatabase.objectStoreNames; @docsEditable true
9760 @Returns('_DOMStringList') @Creates('_DOMStringList')
9761 final List<String> objectStoreNames;
9762
9763 /// @domName IDBDatabase.version; @docsEditable true
9764 final dynamic version;
9765
9766 /// @domName IDBDatabase.addEventListener; @docsEditable true
9767 @JSName('addEventListener')
9768 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
9769
9770 /// @domName IDBDatabase.close; @docsEditable true
9771 void close() native;
9772
9773 /// @domName IDBDatabase.createObjectStore; @docsEditable true
9774 IDBObjectStore createObjectStore(String name, [Map options]) {
9775 if (?options) {
9776 var options_1 = convertDartToNative_Dictionary(options);
9777 return _createObjectStore_1(name, options_1);
9778 }
9779 return _createObjectStore_2(name);
9780 }
9781 @JSName('createObjectStore')
9782 IDBObjectStore _createObjectStore_1(name, options) native;
9783 @JSName('createObjectStore')
9784 IDBObjectStore _createObjectStore_2(name) native;
9785
9786 /// @domName IDBDatabase.deleteObjectStore; @docsEditable true
9787 void deleteObjectStore(String name) native;
9788
9789 /// @domName IDBDatabase.dispatchEvent; @docsEditable true
9790 @JSName('dispatchEvent')
9791 bool $dom_dispatchEvent(Event evt) native;
9792
9793 /// @domName IDBDatabase.removeEventListener; @docsEditable true
9794 @JSName('removeEventListener')
9795 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
9796
9797 /// @domName IDBDatabase.setVersion; @docsEditable true
9798 IDBVersionChangeRequest setVersion(String version) native;
9799 }
9800
9801 // TODO(sra): This should be a static member of IDBTransaction but dart2js
9802 // can't handle that. Move it back after dart2js is completely done.
9803 var _transaction_fn; // Assigned one of the static methods.
9804
9805 class IDBDatabaseEvents extends Events {
9806 IDBDatabaseEvents(EventTarget _ptr) : super(_ptr);
9807
9808 EventListenerList get abort => this['abort'];
9809
9810 EventListenerList get error => this['error'];
9811
9812 EventListenerList get versionChange => this['versionchange'];
9813 }
9814 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9815 // for details. All rights reserved. Use of this source code is governed by a
9816 // BSD-style license that can be found in the LICENSE file.
9817
9818
9819 /// @domName IDBDatabaseException; @docsEditable true
9820 class IDBDatabaseException native "*IDBDatabaseException" {
9821
9822 static const int ABORT_ERR = 20;
9823
9824 static const int CONSTRAINT_ERR = 4;
9825
9826 static const int DATA_ERR = 5;
9827
9828 static const int NON_TRANSIENT_ERR = 2;
9829
9830 static const int NOT_ALLOWED_ERR = 6;
9831
9832 static const int NOT_FOUND_ERR = 8;
9833
9834 static const int NO_ERR = 0;
9835
9836 static const int QUOTA_ERR = 22;
9837
9838 static const int READ_ONLY_ERR = 9;
9839
9840 static const int TIMEOUT_ERR = 23;
9841
9842 static const int TRANSACTION_INACTIVE_ERR = 7;
9843
9844 static const int UNKNOWN_ERR = 1;
9845
9846 static const int VER_ERR = 12;
9847
9848 /// @domName IDBDatabaseException.code; @docsEditable true
9849 final int code;
9850
9851 /// @domName IDBDatabaseException.message; @docsEditable true
9852 final String message;
9853
9854 /// @domName IDBDatabaseException.name; @docsEditable true
9855 final String name;
9856
9857 /// @domName IDBDatabaseException.toString; @docsEditable true
9858 String toString() native;
9859 }
9860 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9861 // for details. All rights reserved. Use of this source code is governed by a
9862 // BSD-style license that can be found in the LICENSE file.
9863
9864
9865 /// @domName IDBFactory; @docsEditable true
9866 class IDBFactory native "*IDBFactory" {
9867
9868 /// @domName IDBFactory.cmp; @docsEditable true
9869 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) {
9870 var first_1 = _convertDartToNative_IDBKey(first);
9871 var second_2 = _convertDartToNative_IDBKey(second);
9872 return _cmp_1(first_1, second_2);
9873 }
9874 @JSName('cmp')
9875 int _cmp_1(first, second) native;
9876
9877 /// @domName IDBFactory.deleteDatabase; @docsEditable true
9878 IDBVersionChangeRequest deleteDatabase(String name) native;
9879
9880 /// @domName IDBFactory.open; @docsEditable true
9881 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBDatabase')
9882 IDBOpenDBRequest open(String name, [int version]) native;
9883
9884 /// @domName IDBFactory.webkitGetDatabaseNames; @docsEditable true
9885 IDBRequest webkitGetDatabaseNames() native;
9886 }
9887 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9888 // for details. All rights reserved. Use of this source code is governed by a
9889 // BSD-style license that can be found in the LICENSE file.
9890
9891
9892 /// @domName IDBIndex; @docsEditable true
9893 class IDBIndex native "*IDBIndex" {
9894
9895 /// @domName IDBIndex.keyPath; @docsEditable true
9896 final dynamic keyPath;
9897
9898 /// @domName IDBIndex.multiEntry; @docsEditable true
9899 final bool multiEntry;
9900
9901 /// @domName IDBIndex.name; @docsEditable true
9902 final String name;
9903
9904 /// @domName IDBIndex.objectStore; @docsEditable true
9905 final IDBObjectStore objectStore;
9906
9907 /// @domName IDBIndex.unique; @docsEditable true
9908 final bool unique;
9909
9910 /// @domName IDBIndex.count; @docsEditable true
9911 IDBRequest count([key_OR_range]) {
9912 if (!?key_OR_range) {
9913 return _count_1();
9914 }
9915 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
9916 return _count_2(key_OR_range);
9917 }
9918 if (?key_OR_range) {
9919 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
9920 return _count_3(key_1);
9921 }
9922 throw new ArgumentError("Incorrect number or type of arguments");
9923 }
9924 @JSName('count')
9925 IDBRequest _count_1() native;
9926 @JSName('count')
9927 IDBRequest _count_2(IDBKeyRange range) native;
9928 @JSName('count')
9929 IDBRequest _count_3(key) native;
9930
9931 /// @domName IDBIndex.get; @docsEditable true
9932 IDBRequest get(key) {
9933 if ((?key && (key is IDBKeyRange || key == null))) {
9934 return _get_1(key);
9935 }
9936 if (?key) {
9937 var key_1 = _convertDartToNative_IDBKey(key);
9938 return _get_2(key_1);
9939 }
9940 throw new ArgumentError("Incorrect number or type of arguments");
9941 }
9942 @JSName('get')
9943 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
9944 IDBRequest _get_1(IDBKeyRange key) native;
9945 @JSName('get')
9946 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
9947 IDBRequest _get_2(key) native;
9948
9949 /// @domName IDBIndex.getKey; @docsEditable true
9950 IDBRequest getKey(key) {
9951 if ((?key && (key is IDBKeyRange || key == null))) {
9952 return _getKey_1(key);
9953 }
9954 if (?key) {
9955 var key_1 = _convertDartToNative_IDBKey(key);
9956 return _getKey_2(key_1);
9957 }
9958 throw new ArgumentError("Incorrect number or type of arguments");
9959 }
9960 @JSName('getKey')
9961 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue @Creates('IDBObjectStore')
9962 IDBRequest _getKey_1(IDBKeyRange key) native;
9963 @JSName('getKey')
9964 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue @Creates('IDBObjectStore')
9965 IDBRequest _getKey_2(key) native;
9966
9967 /// @domName IDBIndex.openCursor; @docsEditable true
9968 IDBRequest openCursor([key_OR_range, String direction]) {
9969 if (!?key_OR_range &&
9970 !?direction) {
9971 return _openCursor_1();
9972 }
9973 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) &&
9974 !?direction) {
9975 return _openCursor_2(key_OR_range);
9976 }
9977 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
9978 return _openCursor_3(key_OR_range, direction);
9979 }
9980 if (?key_OR_range &&
9981 !?direction) {
9982 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
9983 return _openCursor_4(key_1);
9984 }
9985 if (?key_OR_range) {
9986 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
9987 return _openCursor_5(key_2, direction);
9988 }
9989 throw new ArgumentError("Incorrect number or type of arguments");
9990 }
9991 @JSName('openCursor')
9992 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
9993 IDBRequest _openCursor_1() native;
9994 @JSName('openCursor')
9995 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
9996 IDBRequest _openCursor_2(IDBKeyRange range) native;
9997 @JSName('openCursor')
9998 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
9999 IDBRequest _openCursor_3(IDBKeyRange range, direction) native;
10000 @JSName('openCursor')
10001 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10002 IDBRequest _openCursor_4(key) native;
10003 @JSName('openCursor')
10004 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10005 IDBRequest _openCursor_5(key, direction) native;
10006
10007 /// @domName IDBIndex.openKeyCursor; @docsEditable true
10008 IDBRequest openKeyCursor([key_OR_range, String direction]) {
10009 if (!?key_OR_range &&
10010 !?direction) {
10011 return _openKeyCursor_1();
10012 }
10013 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) &&
10014 !?direction) {
10015 return _openKeyCursor_2(key_OR_range);
10016 }
10017 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
10018 return _openKeyCursor_3(key_OR_range, direction);
10019 }
10020 if (?key_OR_range &&
10021 !?direction) {
10022 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10023 return _openKeyCursor_4(key_1);
10024 }
10025 if (?key_OR_range) {
10026 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
10027 return _openKeyCursor_5(key_2, direction);
10028 }
10029 throw new ArgumentError("Incorrect number or type of arguments");
10030 }
10031 @JSName('openKeyCursor')
10032 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10033 IDBRequest _openKeyCursor_1() native;
10034 @JSName('openKeyCursor')
10035 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10036 IDBRequest _openKeyCursor_2(IDBKeyRange range) native;
10037 @JSName('openKeyCursor')
10038 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10039 IDBRequest _openKeyCursor_3(IDBKeyRange range, direction) native;
10040 @JSName('openKeyCursor')
10041 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10042 IDBRequest _openKeyCursor_4(key) native;
10043 @JSName('openKeyCursor')
10044 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10045 IDBRequest _openKeyCursor_5(key, direction) native;
10046 }
10047 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10048 // for details. All rights reserved. Use of this source code is governed by a
10049 // BSD-style license that can be found in the LICENSE file.
10050
10051
10052 /// @domName IDBKey; @docsEditable true
10053 class IDBKey native "*IDBKey" {
10054 }
10055 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10056 // for details. All rights reserved. Use of this source code is governed by a
10057 // BSD-style license that can be found in the LICENSE file.
10058
10059
10060 /// @domName IDBKeyRange
10061 class IDBKeyRange native "*IDBKeyRange" {
10062 /**
10063 * @domName IDBKeyRange.only
10064 */
10065 factory IDBKeyRange.only(/*IDBKey*/ value) =>
10066 _IDBKeyRangeFactoryProvider.createIDBKeyRange_only(value);
10067
10068 /**
10069 * @domName IDBKeyRange.lowerBound
10070 */
10071 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) =>
10072 _IDBKeyRangeFactoryProvider.createIDBKeyRange_lowerBound(bound, open);
10073
10074 /**
10075 * @domName IDBKeyRange.upperBound
10076 */
10077 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) =>
10078 _IDBKeyRangeFactoryProvider.createIDBKeyRange_upperBound(bound, open);
10079
10080 /**
10081 * @domName IDBKeyRange.bound
10082 */
10083 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
10084 [bool lowerOpen = false, bool upperOpen = false]) =>
10085 _IDBKeyRangeFactoryProvider.createIDBKeyRange_bound(
10086 lower, upper, lowerOpen, upperOpen);
10087
10088
10089 /// @domName IDBKeyRange.lower; @docsEditable true
10090 dynamic get lower => _convertNativeToDart_IDBKey(this._lower);
10091 @JSName('lower')
10092 final dynamic _lower;
10093
10094 /// @domName IDBKeyRange.lowerOpen; @docsEditable true
10095 final bool lowerOpen;
10096
10097 /// @domName IDBKeyRange.upper; @docsEditable true
10098 dynamic get upper => _convertNativeToDart_IDBKey(this._upper);
10099 @JSName('upper')
10100 final dynamic _upper;
10101
10102 /// @domName IDBKeyRange.upperOpen; @docsEditable true
10103 final bool upperOpen;
10104
10105 /// @domName IDBKeyRange.bound_; @docsEditable true
10106 static IDBKeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bool upperOpen]) {
10107 if (?upperOpen) {
10108 var lower_1 = _convertDartToNative_IDBKey(lower);
10109 var upper_2 = _convertDartToNative_IDBKey(upper);
10110 return _bound__1(lower_1, upper_2, lowerOpen, upperOpen);
10111 }
10112 if (?lowerOpen) {
10113 var lower_3 = _convertDartToNative_IDBKey(lower);
10114 var upper_4 = _convertDartToNative_IDBKey(upper);
10115 return _bound__2(lower_3, upper_4, lowerOpen);
10116 }
10117 var lower_5 = _convertDartToNative_IDBKey(lower);
10118 var upper_6 = _convertDartToNative_IDBKey(upper);
10119 return _bound__3(lower_5, upper_6);
10120 }
10121 @JSName('bound')
10122 static IDBKeyRange _bound__1(lower, upper, lowerOpen, upperOpen) native;
10123 @JSName('bound')
10124 static IDBKeyRange _bound__2(lower, upper, lowerOpen) native;
10125 @JSName('bound')
10126 static IDBKeyRange _bound__3(lower, upper) native;
10127
10128 /// @domName IDBKeyRange.lowerBound_; @docsEditable true
10129 static IDBKeyRange lowerBound_(/*IDBKey*/ bound, [bool open]) {
10130 if (?open) {
10131 var bound_1 = _convertDartToNative_IDBKey(bound);
10132 return _lowerBound__1(bound_1, open);
10133 }
10134 var bound_2 = _convertDartToNative_IDBKey(bound);
10135 return _lowerBound__2(bound_2);
10136 }
10137 @JSName('lowerBound')
10138 static IDBKeyRange _lowerBound__1(bound, open) native;
10139 @JSName('lowerBound')
10140 static IDBKeyRange _lowerBound__2(bound) native;
10141
10142 /// @domName IDBKeyRange.only_; @docsEditable true
10143 static IDBKeyRange only_(/*IDBKey*/ value) {
10144 var value_1 = _convertDartToNative_IDBKey(value);
10145 return _only__1(value_1);
10146 }
10147 @JSName('only')
10148 static IDBKeyRange _only__1(value) native;
10149
10150 /// @domName IDBKeyRange.upperBound_; @docsEditable true
10151 static IDBKeyRange upperBound_(/*IDBKey*/ bound, [bool open]) {
10152 if (?open) {
10153 var bound_1 = _convertDartToNative_IDBKey(bound);
10154 return _upperBound__1(bound_1, open);
10155 }
10156 var bound_2 = _convertDartToNative_IDBKey(bound);
10157 return _upperBound__2(bound_2);
10158 }
10159 @JSName('upperBound')
10160 static IDBKeyRange _upperBound__1(bound, open) native;
10161 @JSName('upperBound')
10162 static IDBKeyRange _upperBound__2(bound) native;
10163
10164 }
10165 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10166 // for details. All rights reserved. Use of this source code is governed by a
10167 // BSD-style license that can be found in the LICENSE file.
10168
10169
10170 /// @domName IDBObjectStore; @docsEditable true
10171 class IDBObjectStore native "*IDBObjectStore" {
10172
10173 /// @domName IDBObjectStore.autoIncrement; @docsEditable true
10174 final bool autoIncrement;
10175
10176 /// @domName IDBObjectStore.indexNames; @docsEditable true
10177 @Returns('_DOMStringList') @Creates('_DOMStringList')
10178 final List<String> indexNames;
10179
10180 /// @domName IDBObjectStore.keyPath; @docsEditable true
10181 final dynamic keyPath;
10182
10183 /// @domName IDBObjectStore.name; @docsEditable true
10184 final String name;
10185
10186 /// @domName IDBObjectStore.transaction; @docsEditable true
10187 final IDBTransaction transaction;
10188
10189 /// @domName IDBObjectStore.add; @docsEditable true
10190 IDBRequest add(/*any*/ value, [/*IDBKey*/ key]) {
10191 if (?key) {
10192 var value_1 = convertDartToNative_SerializedScriptValue(value);
10193 var key_2 = _convertDartToNative_IDBKey(key);
10194 return _add_1(value_1, key_2);
10195 }
10196 var value_3 = convertDartToNative_SerializedScriptValue(value);
10197 return _add_2(value_3);
10198 }
10199 @JSName('add')
10200 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey
10201 IDBRequest _add_1(value, key) native;
10202 @JSName('add')
10203 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey
10204 IDBRequest _add_2(value) native;
10205
10206 /// @domName IDBObjectStore.clear; @docsEditable true
10207 IDBRequest clear() native;
10208
10209 /// @domName IDBObjectStore.count; @docsEditable true
10210 IDBRequest count([key_OR_range]) {
10211 if (!?key_OR_range) {
10212 return _count_1();
10213 }
10214 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
10215 return _count_2(key_OR_range);
10216 }
10217 if (?key_OR_range) {
10218 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10219 return _count_3(key_1);
10220 }
10221 throw new ArgumentError("Incorrect number or type of arguments");
10222 }
10223 @JSName('count')
10224 IDBRequest _count_1() native;
10225 @JSName('count')
10226 IDBRequest _count_2(IDBKeyRange range) native;
10227 @JSName('count')
10228 IDBRequest _count_3(key) native;
10229
10230 /// @domName IDBObjectStore.createIndex; @docsEditable true
10231 IDBIndex createIndex(String name, keyPath, [Map options]) {
10232 if ((?keyPath && (keyPath is List<String> || keyPath == null)) &&
10233 !?options) {
10234 List keyPath_1 = convertDartToNative_StringArray(keyPath);
10235 return _createIndex_1(name, keyPath_1);
10236 }
10237 if ((?keyPath && (keyPath is List<String> || keyPath == null))) {
10238 List keyPath_2 = convertDartToNative_StringArray(keyPath);
10239 var options_3 = convertDartToNative_Dictionary(options);
10240 return _createIndex_2(name, keyPath_2, options_3);
10241 }
10242 if ((?keyPath && (keyPath is String || keyPath == null)) &&
10243 !?options) {
10244 return _createIndex_3(name, keyPath);
10245 }
10246 if ((?keyPath && (keyPath is String || keyPath == null))) {
10247 var options_4 = convertDartToNative_Dictionary(options);
10248 return _createIndex_4(name, keyPath, options_4);
10249 }
10250 throw new ArgumentError("Incorrect number or type of arguments");
10251 }
10252 @JSName('createIndex')
10253 IDBIndex _createIndex_1(name, List keyPath) native;
10254 @JSName('createIndex')
10255 IDBIndex _createIndex_2(name, List keyPath, options) native;
10256 @JSName('createIndex')
10257 IDBIndex _createIndex_3(name, String keyPath) native;
10258 @JSName('createIndex')
10259 IDBIndex _createIndex_4(name, String keyPath, options) native;
10260
10261 /// @domName IDBObjectStore.delete; @docsEditable true
10262 IDBRequest delete(key_OR_keyRange) {
10263 if ((?key_OR_keyRange && (key_OR_keyRange is IDBKeyRange || key_OR_keyRange == null))) {
10264 return _delete_1(key_OR_keyRange);
10265 }
10266 if (?key_OR_keyRange) {
10267 var key_1 = _convertDartToNative_IDBKey(key_OR_keyRange);
10268 return _delete_2(key_1);
10269 }
10270 throw new ArgumentError("Incorrect number or type of arguments");
10271 }
10272 @JSName('delete')
10273 IDBRequest _delete_1(IDBKeyRange keyRange) native;
10274 @JSName('delete')
10275 IDBRequest _delete_2(key) native;
10276
10277 /// @domName IDBObjectStore.deleteIndex; @docsEditable true
10278 void deleteIndex(String name) native;
10279
10280 /// @domName IDBObjectStore.getObject; @docsEditable true
10281 IDBRequest getObject(key) {
10282 if ((?key && (key is IDBKeyRange || key == null))) {
10283 return _getObject_1(key);
10284 }
10285 if (?key) {
10286 var key_1 = _convertDartToNative_IDBKey(key);
10287 return _getObject_2(key_1);
10288 }
10289 throw new ArgumentError("Incorrect number or type of arguments");
10290 }
10291 @JSName('get')
10292 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
10293 IDBRequest _getObject_1(IDBKeyRange key) native;
10294 @JSName('get')
10295 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
10296 IDBRequest _getObject_2(key) native;
10297
10298 /// @domName IDBObjectStore.index; @docsEditable true
10299 IDBIndex index(String name) native;
10300
10301 /// @domName IDBObjectStore.openCursor; @docsEditable true
10302 IDBRequest openCursor([key_OR_range, String direction]) {
10303 if (!?key_OR_range &&
10304 !?direction) {
10305 return _openCursor_1();
10306 }
10307 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) &&
10308 !?direction) {
10309 return _openCursor_2(key_OR_range);
10310 }
10311 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
10312 return _openCursor_3(key_OR_range, direction);
10313 }
10314 if (?key_OR_range &&
10315 !?direction) {
10316 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10317 return _openCursor_4(key_1);
10318 }
10319 if (?key_OR_range) {
10320 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
10321 return _openCursor_5(key_2, direction);
10322 }
10323 throw new ArgumentError("Incorrect number or type of arguments");
10324 }
10325 @JSName('openCursor')
10326 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10327 IDBRequest _openCursor_1() native;
10328 @JSName('openCursor')
10329 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10330 IDBRequest _openCursor_2(IDBKeyRange range) native;
10331 @JSName('openCursor')
10332 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10333 IDBRequest _openCursor_3(IDBKeyRange range, direction) native;
10334 @JSName('openCursor')
10335 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10336 IDBRequest _openCursor_4(key) native;
10337 @JSName('openCursor')
10338 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10339 IDBRequest _openCursor_5(key, direction) native;
10340
10341 /// @domName IDBObjectStore.put; @docsEditable true
10342 IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) {
10343 if (?key) {
10344 var value_1 = convertDartToNative_SerializedScriptValue(value);
10345 var key_2 = _convertDartToNative_IDBKey(key);
10346 return _put_1(value_1, key_2);
10347 }
10348 var value_3 = convertDartToNative_SerializedScriptValue(value);
10349 return _put_2(value_3);
10350 }
10351 @JSName('put')
10352 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey
10353 IDBRequest _put_1(value, key) native;
10354 @JSName('put')
10355 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey
10356 IDBRequest _put_2(value) native;
10357 }
10358 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10359 // for details. All rights reserved. Use of this source code is governed by a
10360 // BSD-style license that can be found in the LICENSE file.
10361
10362
10363 /// @domName IDBOpenDBRequest; @docsEditable true
10364 class IDBOpenDBRequest extends IDBRequest implements EventTarget native "*IDBOpe nDBRequest" {
10365
10366 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
10367 IDBOpenDBRequestEvents get on =>
10368 new IDBOpenDBRequestEvents(this);
10369 }
10370
10371 class IDBOpenDBRequestEvents extends IDBRequestEvents {
10372 IDBOpenDBRequestEvents(EventTarget _ptr) : super(_ptr);
10373
10374 EventListenerList get blocked => this['blocked'];
10375
10376 EventListenerList get upgradeNeeded => this['upgradeneeded'];
10377 }
10378 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10379 // for details. All rights reserved. Use of this source code is governed by a
10380 // BSD-style license that can be found in the LICENSE file.
10381
10382
10383 /// @domName IDBRequest; @docsEditable true
10384 class IDBRequest extends EventTarget native "*IDBRequest" {
10385
10386 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
10387 IDBRequestEvents get on =>
10388 new IDBRequestEvents(this);
10389
10390 /// @domName IDBRequest.error; @docsEditable true
10391 final DOMError error;
10392
10393 /// @domName IDBRequest.errorCode; @docsEditable true
10394 final int errorCode;
10395
10396 /// @domName IDBRequest.readyState; @docsEditable true
10397 final String readyState;
10398
10399 /// @domName IDBRequest.result; @docsEditable true
10400 dynamic get result => _convertNativeToDart_IDBAny(this._result);
10401 @JSName('result')
10402 @Creates('Null')
10403 final dynamic _result;
10404
10405 /// @domName IDBRequest.source; @docsEditable true
10406 @Creates('Null')
10407 final dynamic source;
10408
10409 /// @domName IDBRequest.transaction; @docsEditable true
10410 final IDBTransaction transaction;
10411
10412 /// @domName IDBRequest.webkitErrorMessage; @docsEditable true
10413 final String webkitErrorMessage;
10414
10415 /// @domName IDBRequest.addEventListener; @docsEditable true
10416 @JSName('addEventListener')
10417 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
10418
10419 /// @domName IDBRequest.dispatchEvent; @docsEditable true
10420 @JSName('dispatchEvent')
10421 bool $dom_dispatchEvent(Event evt) native;
10422
10423 /// @domName IDBRequest.removeEventListener; @docsEditable true
10424 @JSName('removeEventListener')
10425 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
10426 }
10427
10428 class IDBRequestEvents extends Events {
10429 IDBRequestEvents(EventTarget _ptr) : super(_ptr);
10430
10431 EventListenerList get error => this['error'];
10432
10433 EventListenerList get success => this['success'];
10434 }
10435 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10436 // for details. All rights reserved. Use of this source code is governed by a
10437 // BSD-style license that can be found in the LICENSE file.
10438
10439
10440 /// @domName IDBTransaction; @docsEditable true
10441 class IDBTransaction extends EventTarget native "*IDBTransaction" {
10442
10443 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
10444 IDBTransactionEvents get on =>
10445 new IDBTransactionEvents(this);
10446
10447 static const int READ_ONLY = 0;
10448
10449 static const int READ_WRITE = 1;
10450
10451 static const int VERSION_CHANGE = 2;
10452
10453 /// @domName IDBTransaction.db; @docsEditable true
10454 final IDBDatabase db;
10455
10456 /// @domName IDBTransaction.error; @docsEditable true
10457 final DOMError error;
10458
10459 /// @domName IDBTransaction.mode; @docsEditable true
10460 final String mode;
10461
10462 /// @domName IDBTransaction.abort; @docsEditable true
10463 void abort() native;
10464
10465 /// @domName IDBTransaction.addEventListener; @docsEditable true
10466 @JSName('addEventListener')
10467 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
10468
10469 /// @domName IDBTransaction.dispatchEvent; @docsEditable true
10470 @JSName('dispatchEvent')
10471 bool $dom_dispatchEvent(Event evt) native;
10472
10473 /// @domName IDBTransaction.objectStore; @docsEditable true
10474 IDBObjectStore objectStore(String name) native;
10475
10476 /// @domName IDBTransaction.removeEventListener; @docsEditable true
10477 @JSName('removeEventListener')
10478 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
10479 }
10480
10481 class IDBTransactionEvents extends Events {
10482 IDBTransactionEvents(EventTarget _ptr) : super(_ptr);
10483
10484 EventListenerList get abort => this['abort'];
10485
10486 EventListenerList get complete => this['complete'];
10487
10488 EventListenerList get error => this['error'];
10489 }
10490 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10491 // for details. All rights reserved. Use of this source code is governed by a
10492 // BSD-style license that can be found in the LICENSE file.
10493
10494
10495 /// @domName IDBVersionChangeEvent; @docsEditable true
10496 class IDBUpgradeNeededEvent extends Event native "*IDBVersionChangeEvent" {
10497
10498 /// @domName IDBVersionChangeEvent.newVersion; @docsEditable true
10499 final int newVersion;
10500
10501 /// @domName IDBVersionChangeEvent.oldVersion; @docsEditable true
10502 final int oldVersion;
10503 }
10504 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10505 // for details. All rights reserved. Use of this source code is governed by a
10506 // BSD-style license that can be found in the LICENSE file.
10507
10508
10509 /// @domName IDBVersionChangeEvent; @docsEditable true
10510 class IDBVersionChangeEvent extends Event native "*IDBVersionChangeEvent" {
10511
10512 /// @domName IDBVersionChangeEvent.version; @docsEditable true
10513 final String version;
10514 }
10515 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10516 // for details. All rights reserved. Use of this source code is governed by a
10517 // BSD-style license that can be found in the LICENSE file.
10518
10519
10520 /// @domName IDBVersionChangeRequest; @docsEditable true
10521 class IDBVersionChangeRequest extends IDBRequest implements EventTarget native " *IDBVersionChangeRequest" {
10522
10523 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
10524 IDBVersionChangeRequestEvents get on =>
10525 new IDBVersionChangeRequestEvents(this);
10526 }
10527
10528 class IDBVersionChangeRequestEvents extends IDBRequestEvents {
10529 IDBVersionChangeRequestEvents(EventTarget _ptr) : super(_ptr);
10530
10531 EventListenerList get blocked => this['blocked'];
10532 }
10533 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10534 // for details. All rights reserved. Use of this source code is governed by a
10535 // BSD-style license that can be found in the LICENSE file.
10536
10537
10538 /// @domName HTMLIFrameElement; @docsEditable true 9629 /// @domName HTMLIFrameElement; @docsEditable true
10539 class IFrameElement extends Element implements Element native "*HTMLIFrameElemen t" { 9630 class IFrameElement extends Element implements Element native "*HTMLIFrameElemen t" {
10540 9631
10541 factory IFrameElement() => document.$dom_createElement("iframe"); 9632 factory IFrameElement() => document.$dom_createElement("iframe");
10542 9633
10543 /// @domName HTMLIFrameElement.align; @docsEditable true 9634 /// @domName HTMLIFrameElement.align; @docsEditable true
10544 String align; 9635 String align;
10545 9636
10546 /// @domName HTMLIFrameElement.contentWindow; @docsEditable true 9637 /// @domName HTMLIFrameElement.contentWindow; @docsEditable true
10547 Window get contentWindow => _convertNativeToDart_Window(this._contentWindow); 9638 Window get contentWindow => _convertNativeToDart_Window(this._contentWindow);
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
11724 $this.requestAnimationFrame = function(callback) { 10815 $this.requestAnimationFrame = function(callback) {
11725 return window.setTimeout(function() { 10816 return window.setTimeout(function() {
11726 callback(Date.now()); 10817 callback(Date.now());
11727 }, 16 /* 16ms ~= 60fps */); 10818 }, 16 /* 16ms ~= 60fps */);
11728 }; 10819 };
11729 $this.cancelAnimationFrame = function(id) { clearTimeout(id); } 10820 $this.cancelAnimationFrame = function(id) { clearTimeout(id); }
11730 })(#)""", 10821 })(#)""",
11731 this); 10822 this);
11732 } 10823 }
11733 10824
11734 IDBFactory get indexedDB => 10825 IdbFactory get indexedDB =>
11735 JS('IDBFactory', 10826 JS('IdbFactory',
11736 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', 10827 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
11737 this, this, this); 10828 this, this, this);
11738 10829
11739 /** 10830 /**
11740 * Lookup a port by its [name]. Return null if no port is 10831 * Lookup a port by its [name]. Return null if no port is
11741 * registered under [name]. 10832 * registered under [name].
11742 */ 10833 */
11743 SendPortSync lookupPort(String name) { 10834 SendPortSync lookupPort(String name) {
11744 var port = JSON.parse(document.documentElement.attributes['dart-port:$name'] ); 10835 var port = JSON.parse(document.documentElement.attributes['dart-port:$name'] );
11745 return _deserialize(port); 10836 return _deserialize(port);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
11892 10983
11893 /// @domName Window.toolbar; @docsEditable true 10984 /// @domName Window.toolbar; @docsEditable true
11894 final BarInfo toolbar; 10985 final BarInfo toolbar;
11895 10986
11896 /// @domName Window.top; @docsEditable true 10987 /// @domName Window.top; @docsEditable true
11897 Window get top => _convertNativeToDart_Window(this._top); 10988 Window get top => _convertNativeToDart_Window(this._top);
11898 @JSName('top') 10989 @JSName('top')
11899 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') 10990 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object')
11900 final dynamic _top; 10991 final dynamic _top;
11901 10992
11902 /// @domName DOMWindow.webkitIndexedDB; @docsEditable true
11903 final IDBFactory webkitIndexedDB;
11904
11905 /// @domName DOMWindow.webkitNotifications; @docsEditable true 10993 /// @domName DOMWindow.webkitNotifications; @docsEditable true
11906 final NotificationCenter webkitNotifications; 10994 final NotificationCenter webkitNotifications;
11907 10995
11908 /// @domName DOMWindow.webkitStorageInfo; @docsEditable true 10996 /// @domName DOMWindow.webkitStorageInfo; @docsEditable true
11909 final StorageInfo webkitStorageInfo; 10997 final StorageInfo webkitStorageInfo;
11910 10998
11911 /// @domName Window.window; @docsEditable true 10999 /// @domName Window.window; @docsEditable true
11912 Window get window => _convertNativeToDart_Window(this._window); 11000 Window get window => _convertNativeToDart_Window(this._window);
11913 @JSName('window') 11001 @JSName('window')
11914 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') 11002 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object')
(...skipping 8087 matching lines...) Expand 10 before | Expand all | Expand 10 after
20002 class WorkerEvents extends AbstractWorkerEvents { 19090 class WorkerEvents extends AbstractWorkerEvents {
20003 WorkerEvents(EventTarget _ptr) : super(_ptr); 19091 WorkerEvents(EventTarget _ptr) : super(_ptr);
20004 19092
20005 EventListenerList get message => this['message']; 19093 EventListenerList get message => this['message'];
20006 } 19094 }
20007 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19095 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
20008 // for details. All rights reserved. Use of this source code is governed by a 19096 // for details. All rights reserved. Use of this source code is governed by a
20009 // BSD-style license that can be found in the LICENSE file. 19097 // BSD-style license that can be found in the LICENSE file.
20010 19098
20011 19099
20012 /// @domName WorkerContext; @docsEditable true 19100 /// @domName WorkerContext
20013 class WorkerContext extends EventTarget native "*WorkerContext" { 19101 class WorkerContext extends EventTarget native "*WorkerContext" {
20014 19102
20015 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 19103 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
20016 WorkerContextEvents get on => 19104 WorkerContextEvents get on =>
20017 new WorkerContextEvents(this); 19105 new WorkerContextEvents(this);
20018 19106
20019 static const int PERSISTENT = 1; 19107 static const int PERSISTENT = 1;
20020 19108
20021 static const int TEMPORARY = 0; 19109 static const int TEMPORARY = 0;
20022 19110
20023 /// @domName WorkerContext.indexedDB; @docsEditable true
20024 final IDBFactory indexedDB;
20025
20026 /// @domName WorkerContext.location; @docsEditable true 19111 /// @domName WorkerContext.location; @docsEditable true
20027 final WorkerLocation location; 19112 final WorkerLocation location;
20028 19113
20029 /// @domName WorkerContext.navigator; @docsEditable true 19114 /// @domName WorkerContext.navigator; @docsEditable true
20030 final WorkerNavigator navigator; 19115 final WorkerNavigator navigator;
20031 19116
20032 /// @domName WorkerContext.self; @docsEditable true 19117 /// @domName WorkerContext.self; @docsEditable true
20033 final WorkerContext self; 19118 final WorkerContext self;
20034 19119
20035 /// @domName WorkerContext.webkitIndexedDB; @docsEditable true
20036 final IDBFactory webkitIndexedDB;
20037
20038 /// @domName WorkerContext.webkitNotifications; @docsEditable true 19120 /// @domName WorkerContext.webkitNotifications; @docsEditable true
20039 final NotificationCenter webkitNotifications; 19121 final NotificationCenter webkitNotifications;
20040 19122
20041 /// @domName WorkerContext.addEventListener; @docsEditable true 19123 /// @domName WorkerContext.addEventListener; @docsEditable true
20042 @JSName('addEventListener') 19124 @JSName('addEventListener')
20043 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 19125 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
20044 19126
20045 /// @domName WorkerContext.clearInterval; @docsEditable true 19127 /// @domName WorkerContext.clearInterval; @docsEditable true
20046 void clearInterval(int handle) native; 19128 void clearInterval(int handle) native;
20047 19129
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
20080 /// @domName WorkerContext.webkitRequestFileSystemSync; @docsEditable true 19162 /// @domName WorkerContext.webkitRequestFileSystemSync; @docsEditable true
20081 DOMFileSystemSync webkitRequestFileSystemSync(int type, int size) native; 19163 DOMFileSystemSync webkitRequestFileSystemSync(int type, int size) native;
20082 19164
20083 /// @domName WorkerContext.webkitResolveLocalFileSystemSyncURL; @docsEditable true 19165 /// @domName WorkerContext.webkitResolveLocalFileSystemSyncURL; @docsEditable true
20084 @JSName('webkitResolveLocalFileSystemSyncURL') 19166 @JSName('webkitResolveLocalFileSystemSyncURL')
20085 EntrySync webkitResolveLocalFileSystemSyncUrl(String url) native; 19167 EntrySync webkitResolveLocalFileSystemSyncUrl(String url) native;
20086 19168
20087 /// @domName WorkerContext.webkitResolveLocalFileSystemURL; @docsEditable true 19169 /// @domName WorkerContext.webkitResolveLocalFileSystemURL; @docsEditable true
20088 @JSName('webkitResolveLocalFileSystemURL') 19170 @JSName('webkitResolveLocalFileSystemURL')
20089 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback , [ErrorCallback errorCallback]) native; 19171 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback , [ErrorCallback errorCallback]) native;
19172
19173
19174 IdbFactory get indexedDB =>
19175 JS('IdbFactory',
19176 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
19177 this, this, this);
20090 } 19178 }
20091 19179
20092 class WorkerContextEvents extends Events { 19180 class WorkerContextEvents extends Events {
20093 WorkerContextEvents(EventTarget _ptr) : super(_ptr); 19181 WorkerContextEvents(EventTarget _ptr) : super(_ptr);
20094 19182
20095 EventListenerList get error => this['error']; 19183 EventListenerList get error => this['error'];
20096 } 19184 }
20097 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19185 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
20098 // for details. All rights reserved. Use of this source code is governed by a 19186 // for details. All rights reserved. Use of this source code is governed by a
20099 // BSD-style license that can be found in the LICENSE file. 19187 // BSD-style license that can be found in the LICENSE file.
(...skipping 4539 matching lines...) Expand 10 before | Expand all | Expand 10 after
24639 23727
24640 // We can get rid of this conversion if _TypedImageData implements the fields 23728 // We can get rid of this conversion if _TypedImageData implements the fields
24641 // with native names. 23729 // with native names.
24642 _convertDartToNative_ImageData(ImageData imageData) { 23730 _convertDartToNative_ImageData(ImageData imageData) {
24643 if (imageData is _TypedImageData) { 23731 if (imageData is _TypedImageData) {
24644 return JS('', '{data: #, height: #, width: #}', 23732 return JS('', '{data: #, height: #, width: #}',
24645 imageData.data, imageData.height, imageData.width); 23733 imageData.data, imageData.height, imageData.width);
24646 } 23734 }
24647 return imageData; 23735 return imageData;
24648 } 23736 }
24649
24650
24651 // -----------------------------------------------------------------------------
24652
24653 /**
24654 * Converts a native IDBKey into a Dart object.
24655 *
24656 * May return the original input. May mutate the original input (but will be
24657 * idempotent if mutation occurs). It is assumed that this conversion happens
24658 * on native IDBKeys on all paths that return IDBKeys from native DOM calls.
24659 *
24660 * If necessary, JavaScript Dates are converted into Dart Dates.
24661 */
24662 _convertNativeToDart_IDBKey(nativeKey) {
24663 containsDate(object) {
24664 if (isJavaScriptDate(object)) return true;
24665 if (object is List) {
24666 for (int i = 0; i < object.length; i++) {
24667 if (containsDate(object[i])) return true;
24668 }
24669 }
24670 return false; // number, string.
24671 }
24672 if (containsDate(nativeKey)) {
24673 throw new UnimplementedError('IDBKey containing Date');
24674 }
24675 // TODO: Cache conversion somewhere?
24676 return nativeKey;
24677 }
24678
24679 /**
24680 * Converts a Dart object into a valid IDBKey.
24681 *
24682 * May return the original input. Does not mutate input.
24683 *
24684 * If necessary, [dartKey] may be copied to ensure all lists are converted into
24685 * JavaScript Arrays and Dart Dates into JavaScript Dates.
24686 */
24687 _convertDartToNative_IDBKey(dartKey) {
24688 // TODO: Implement.
24689 return dartKey;
24690 }
24691
24692
24693
24694 /// May modify original. If so, action is idempotent.
24695 _convertNativeToDart_IDBAny(object) {
24696 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false);
24697 }
24698
24699
24700 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add Date.
24701 const _annotation_Creates_IDBKey = const Creates(_idbKey);
24702 const _annotation_Returns_IDBKey = const Returns(_idbKey);
24703 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 23737 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24704 // for details. All rights reserved. Use of this source code is governed by a 23738 // for details. All rights reserved. Use of this source code is governed by a
24705 // BSD-style license that can be found in the LICENSE file. 23739 // BSD-style license that can be found in the LICENSE file.
24706 23740
24707 23741
24708 // TODO(vsm): Unify with Dartium version. 23742 // TODO(vsm): Unify with Dartium version.
24709 class _DOMWindowCrossFrame implements Window { 23743 class _DOMWindowCrossFrame implements Window {
24710 // Private window. Note, this is a window in another frame, so it 23744 // Private window. Note, this is a window in another frame, so it
24711 // cannot be typed as "Window" as its prototype is not patched 23745 // cannot be typed as "Window" as its prototype is not patched
24712 // properly. Its fields and methods can only be accessed via JavaScript. 23746 // properly. Its fields and methods can only be accessed via JavaScript.
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
24919 23953
24920 class _WebSocketFactoryProvider { 23954 class _WebSocketFactoryProvider {
24921 static WebSocket createWebSocket(String url) => 23955 static WebSocket createWebSocket(String url) =>
24922 JS('WebSocket', 'new WebSocket(#)', url); 23956 JS('WebSocket', 'new WebSocket(#)', url);
24923 } 23957 }
24924 23958
24925 class _TextFactoryProvider { 23959 class _TextFactoryProvider {
24926 static Text createText(String data) => 23960 static Text createText(String data) =>
24927 JS('Text', 'document.createTextNode(#)', data); 23961 JS('Text', 'document.createTextNode(#)', data);
24928 } 23962 }
24929 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24930 // for details. All rights reserved. Use of this source code is governed by a
24931 // BSD-style license that can be found in the LICENSE file.
24932
24933
24934 class _IDBKeyRangeFactoryProvider {
24935
24936 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) =>
24937 _only(_class(), _translateKey(value));
24938
24939 static IDBKeyRange createIDBKeyRange_lowerBound(
24940 /*IDBKey*/ bound, [bool open = false]) =>
24941 _lowerBound(_class(), _translateKey(bound), open);
24942
24943 static IDBKeyRange createIDBKeyRange_upperBound(
24944 /*IDBKey*/ bound, [bool open = false]) =>
24945 _upperBound(_class(), _translateKey(bound), open);
24946
24947 static IDBKeyRange createIDBKeyRange_bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
24948 [bool lowerOpen = false, bool upperOpen = false]) =>
24949 _bound(_class(), _translateKey(lower), _translateKey(upper),
24950 lowerOpen, upperOpen);
24951
24952 static var _cachedClass;
24953
24954 static _class() {
24955 if (_cachedClass != null) return _cachedClass;
24956 return _cachedClass = _uncachedClass();
24957 }
24958
24959 static _uncachedClass() =>
24960 JS('var',
24961 '''window.webkitIDBKeyRange || window.mozIDBKeyRange ||
24962 window.msIDBKeyRange || window.IDBKeyRange''');
24963
24964 static _translateKey(idbkey) => idbkey; // TODO: fixme.
24965
24966 static IDBKeyRange _only(cls, value) =>
24967 JS('IDBKeyRange', '#.only(#)', cls, value);
24968
24969 static IDBKeyRange _lowerBound(cls, bound, open) =>
24970 JS('IDBKeyRange', '#.lowerBound(#, #)', cls, bound, open);
24971
24972 static IDBKeyRange _upperBound(cls, bound, open) =>
24973 JS('IDBKeyRange', '#.upperBound(#, #)', cls, bound, open);
24974
24975 static IDBKeyRange _bound(cls, lower, upper, lowerOpen, upperOpen) =>
24976 JS('IDBKeyRange', '#.bound(#, #, #, #)',
24977 cls, lower, upper, lowerOpen, upperOpen);
24978 }
24979 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 23963 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
24980 // for details. All rights reserved. Use of this source code is governed by a 23964 // for details. All rights reserved. Use of this source code is governed by a
24981 // BSD-style license that can be found in the LICENSE file. 23965 // BSD-style license that can be found in the LICENSE file.
24982 23966
24983 23967
24984 // On Firefox 11, the object obtained from 'window.location' is very strange. 23968 // On Firefox 11, the object obtained from 'window.location' is very strange.
24985 // It can't be monkey-patched and seems immune to putting methods on 23969 // It can't be monkey-patched and seems immune to putting methods on
24986 // Object.prototype. We are forced to wrap the object. 23970 // Object.prototype. We are forced to wrap the object.
24987 23971
24988 class _LocationWrapper implements LocalLocation { 23972 class _LocationWrapper implements LocalLocation {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
25267 T next() { 24251 T next() {
25268 if (!hasNext) { 24252 if (!hasNext) {
25269 throw new StateError("No more elements"); 24253 throw new StateError("No more elements");
25270 } 24254 }
25271 return _array[_pos++]; 24255 return _array[_pos++];
25272 } 24256 }
25273 24257
25274 final List<T> _array; 24258 final List<T> _array;
25275 int _pos; 24259 int _pos;
25276 } 24260 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/libraries.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698