OLD | NEW |
(Empty) | |
| 1 |
| 2 class _WorkerContextImpl extends _DOMTypeBase implements WorkerContext { |
| 3 _WorkerContextImpl._wrap(ptr) : super._wrap(ptr); |
| 4 |
| 5 WorkerLocation get location() => _wrap(_ptr.location); |
| 6 |
| 7 WorkerNavigator get navigator() => _wrap(_ptr.navigator); |
| 8 |
| 9 EventListener get onerror() => _wrap(_ptr.onerror); |
| 10 |
| 11 void set onerror(EventListener value) { _ptr.onerror = _unwrap(value); } |
| 12 |
| 13 WorkerContext get self() => _wrap(_ptr.self); |
| 14 |
| 15 IDBFactory get webkitIndexedDB() => _wrap(_ptr.webkitIndexedDB); |
| 16 |
| 17 NotificationCenter get webkitNotifications() => _wrap(_ptr.webkitNotifications
); |
| 18 |
| 19 void addEventListener(String type, EventListener listener, [bool useCapture =
null]) { |
| 20 if (useCapture === null) { |
| 21 _ptr.addEventListener(_unwrap(type), _unwrap(listener)); |
| 22 return; |
| 23 } else { |
| 24 _ptr.addEventListener(_unwrap(type), _unwrap(listener), _unwrap(useCapture
)); |
| 25 return; |
| 26 } |
| 27 } |
| 28 |
| 29 void clearInterval(int handle) { |
| 30 _ptr.clearInterval(_unwrap(handle)); |
| 31 return; |
| 32 } |
| 33 |
| 34 void clearTimeout(int handle) { |
| 35 _ptr.clearTimeout(_unwrap(handle)); |
| 36 return; |
| 37 } |
| 38 |
| 39 void close() { |
| 40 _ptr.close(); |
| 41 return; |
| 42 } |
| 43 |
| 44 bool dispatchEvent(Event evt) { |
| 45 return _wrap(_ptr.dispatchEvent(_unwrap(evt))); |
| 46 } |
| 47 |
| 48 void importScripts() { |
| 49 _ptr.importScripts(); |
| 50 return; |
| 51 } |
| 52 |
| 53 Database openDatabase(String name, String version, String displayName, int est
imatedSize, [DatabaseCallback creationCallback = null]) { |
| 54 if (creationCallback === null) { |
| 55 return _wrap(_ptr.openDatabase(_unwrap(name), _unwrap(version), _unwrap(di
splayName), _unwrap(estimatedSize))); |
| 56 } else { |
| 57 return _wrap(_ptr.openDatabase(_unwrap(name), _unwrap(version), _unwrap(di
splayName), _unwrap(estimatedSize), _unwrap(creationCallback))); |
| 58 } |
| 59 } |
| 60 |
| 61 DatabaseSync openDatabaseSync(String name, String version, String displayName,
int estimatedSize, [DatabaseCallback creationCallback = null]) { |
| 62 if (creationCallback === null) { |
| 63 return _wrap(_ptr.openDatabaseSync(_unwrap(name), _unwrap(version), _unwra
p(displayName), _unwrap(estimatedSize))); |
| 64 } else { |
| 65 return _wrap(_ptr.openDatabaseSync(_unwrap(name), _unwrap(version), _unwra
p(displayName), _unwrap(estimatedSize), _unwrap(creationCallback))); |
| 66 } |
| 67 } |
| 68 |
| 69 void removeEventListener(String type, EventListener listener, [bool useCapture
= null]) { |
| 70 if (useCapture === null) { |
| 71 _ptr.removeEventListener(_unwrap(type), _unwrap(listener)); |
| 72 return; |
| 73 } else { |
| 74 _ptr.removeEventListener(_unwrap(type), _unwrap(listener), _unwrap(useCapt
ure)); |
| 75 return; |
| 76 } |
| 77 } |
| 78 |
| 79 int setInterval(TimeoutHandler handler, int timeout) { |
| 80 return _wrap(_ptr.setInterval(_unwrap(handler), _unwrap(timeout))); |
| 81 } |
| 82 |
| 83 int setTimeout(TimeoutHandler handler, int timeout) { |
| 84 return _wrap(_ptr.setTimeout(_unwrap(handler), _unwrap(timeout))); |
| 85 } |
| 86 |
| 87 void webkitRequestFileSystem(int type, int size, [FileSystemCallback successCa
llback = null, ErrorCallback errorCallback = null]) { |
| 88 if (successCallback === null) { |
| 89 if (errorCallback === null) { |
| 90 _ptr.webkitRequestFileSystem(_unwrap(type), _unwrap(size)); |
| 91 return; |
| 92 } |
| 93 } else { |
| 94 if (errorCallback === null) { |
| 95 _ptr.webkitRequestFileSystem(_unwrap(type), _unwrap(size), _unwrap(succe
ssCallback)); |
| 96 return; |
| 97 } else { |
| 98 _ptr.webkitRequestFileSystem(_unwrap(type), _unwrap(size), _unwrap(succe
ssCallback), _unwrap(errorCallback)); |
| 99 return; |
| 100 } |
| 101 } |
| 102 throw "Incorrect number or type of arguments"; |
| 103 } |
| 104 |
| 105 DOMFileSystemSync webkitRequestFileSystemSync(int type, int size) { |
| 106 return _wrap(_ptr.webkitRequestFileSystemSync(_unwrap(type), _unwrap(size)))
; |
| 107 } |
| 108 |
| 109 EntrySync webkitResolveLocalFileSystemSyncURL(String url) { |
| 110 return _wrap(_ptr.webkitResolveLocalFileSystemSyncURL(_unwrap(url))); |
| 111 } |
| 112 |
| 113 void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallbac
k = null, ErrorCallback errorCallback = null]) { |
| 114 if (successCallback === null) { |
| 115 if (errorCallback === null) { |
| 116 _ptr.webkitResolveLocalFileSystemURL(_unwrap(url)); |
| 117 return; |
| 118 } |
| 119 } else { |
| 120 if (errorCallback === null) { |
| 121 _ptr.webkitResolveLocalFileSystemURL(_unwrap(url), _unwrap(successCallba
ck)); |
| 122 return; |
| 123 } else { |
| 124 _ptr.webkitResolveLocalFileSystemURL(_unwrap(url), _unwrap(successCallba
ck), _unwrap(errorCallback)); |
| 125 return; |
| 126 } |
| 127 } |
| 128 throw "Incorrect number or type of arguments"; |
| 129 } |
| 130 } |
OLD | NEW |