| commit | 490421d166c6ee1cc5f904960f5d95357f93364c | [log] [tgz] |
|---|---|---|
| author | Terry Lucas <terry@google.com> | Sun Oct 14 22:48:33 2018 +0000 |
| committer | commit-bot@chromium.org <commit-bot@chromium.org> | Sun Oct 14 22:48:33 2018 +0000 |
| tree | c7969dcc46941b492201e65b3932f35dcd8be90d | |
| parent | 77c5677abe7d6e3a30691df720f223f0ad4c1b8e [diff] |
Fixed Service Workers and any Promise/Future API with a Dictionary parameter.
APIs in dart:html (that take a Dictionary) will receive a Dart Map parameter. The Map parameter
must be converted to a Dictionary before passing to the browser's API. Before this change,
any Promise/Future API with a Map/Dictionary parameter never called the Promise and didn't
return a Dart Future - now it does.
This caused a number of breaks especially in Service Workers (register, etc.). Here is a
complete list of the fixed APIs:
BackgroundFetchManager
Future<BackgroundFetchRegistration> fetch(String id, Object requests, [Map options])
CacheStorage
Future match(/*RequestInfo*/ request, [Map options])
CanMakePayment
Future<List<Client>> matchAll([Map options])
CookieStore
Future getAll([Map options])
Future set(String name, String value, [Map options])
CredentialsContainer
Future get([Map options])
Future create([Map options])
DirectoryEntry
Future<Entry> _getDirectory(String path, {Map options})
Future<Entry> _getFile(String path, {Map options})
ImageCapture
Future setOptions(Map photoSettings)
MediaCapabilities
Future<MediaCapabilitiesInfo> decodingInfo(Map configuration)
Future<MediaCapabilitiesInfo> encodingInfo(Map configuration)
MediaStreamTrack
Future applyConstraints([Map constraints])
Navigator
Future requestKeyboardLock([List<String> keyCodes])
Future requestMidiAccess([Map options])
Future share([Map data])
OffscreenCanvas
Future<Blob> convertToBlob([Map options])
PaymentInstruments
Future set(String instrumentKey, Map details)
Permissions
Future<PermissionStatus> query(Map permission)
Future<PermissionStatus> request(Map permissions)
Future<PermissionStatus> revoke(Map permission)
PushManager
Future permissionState([Map options])
Future<PushSubscription> subscribe([Map options])
RtcPeerConnection
REMOVED: Future createAnswer([options_OR_successCallback,
RtcPeerConnectionErrorCallback failureCallback,
Map mediaConstraints])
REMOVED: Future createOffer([options_OR_successCallback,
RtcPeerConnectionErrorCallback failureCallback,
Map rtcOfferOptions])
REMOVED: Future setLocalDescription(Map description, VoidCallback successCallback,
[RtcPeerConnectionErrorCallback failureCallback])
REMOVED: Future setLocalDescription(Map description, VoidCallback successCallback,
[RtcPeerConnectionErrorCallback failureCallback])
Future<RtcSessionDescription> createAnswer([Map options])
Future<RtcSessionDescription> createOffer([Map options])
Future setLocalDescription(Map description)
Future setRemoteDescription(Map description)
ServiceWorkerContainer
Future<ServiceWorkerRegistration> register(String url, [Map options])
ServiceWorkerRegistration
Future<List<Notification>> getNotifications([Map filter])
Future showNotification(String title, [Map options])
VRDevice
Future requestSession([Map options])
Future supportsSession([Map options])
VRSession
Future requestFrameOfReference(String type, [Map options])
Window
Future fetch(/*RequestInfo*/ input, [Map init])
WorkerGlobalScope
Future fetch(/*RequestInfo*/ input, [Map init])
In addition, exposed Service Worker "self" as a static getter named "instance". The
instance is exposed on four different Service Worker classes and can throw a InstanceTypeError
if the instance isn't of the class expected (WorkerGlobalScope.instance will always work
and not throw):
* SharedWorkerGlobalScope.instance
* DedicatedWorkerGlobalScope.instance
* ServiceWorkerGlobalScope.instance
* WorkerGlobalScope.instance
R=vsm@google.com
Bug: #34202
Change-Id: I641ccbff7cc771465dd32c73db20eba5d6667939
Reviewed-on: https://dart-review.googlesource.com/c/74482
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.
Visit the dartlang.org to learn more about the language, tools, getting started, and more.
Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.