| Index: sdk/lib/html/dartium/html_dartium.dart
|
| diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
|
| index 5547397958885d01c71a201e44eef4d18a389458..d2de7a83f4ae3f675627417837add7f8a24fb780 100644
|
| --- a/sdk/lib/html/dartium/html_dartium.dart
|
| +++ b/sdk/lib/html/dartium/html_dartium.dart
|
| @@ -26871,13 +26871,13 @@ class Url extends NativeFieldWrapperClass1 {
|
| if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
|
| return _createObjectURL_1(blob_OR_source_OR_stream);
|
| }
|
| - if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
|
| + if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
|
| return _createObjectURL_2(blob_OR_source_OR_stream);
|
| }
|
| - if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
|
| + if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
|
| return _createObjectURL_3(blob_OR_source_OR_stream);
|
| }
|
| - if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
|
| + if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
|
| return _createObjectURL_4(blob_OR_source_OR_stream);
|
| }
|
| throw new ArgumentError("Incorrect number or type of arguments");
|
| @@ -35676,6 +35676,46 @@ get _pureIsolateTimerFactoryClosure =>
|
| throw new UnimplementedError("Timers on background isolates "
|
| "are not supported in the browser"));
|
|
|
| +class _ScheduleImmediateHelper {
|
| + MutationObserver _observer;
|
| + final DivElement _div = new DivElement();
|
| + Function _callback;
|
| +
|
| + _ScheduleImmediateHelper() {
|
| + // Mutation events get fired as soon as the current event stack is unwound
|
| + // so we just make a dummy event and listen for that.
|
| + _observer = new MutationObserver(_handleMutation);
|
| + _observer.observe(_div, attributes: true);
|
| + }
|
| +
|
| + void _schedule(callback) {
|
| + if (_callback != null) {
|
| + throw new StateError(
|
| + 'Only one immediate callback can be scheduled at once');
|
| + }
|
| + _callback = callback;
|
| + // Toggle it to trigger the mutation event.
|
| + _div.hidden = !_div.hidden;
|
| + }
|
| +
|
| + _handleMutation(List<MutationRecord> mutations, MutationObserver observer) {
|
| + var tmp = _callback;
|
| + _callback = null;
|
| + tmp();
|
| + }
|
| +}
|
| +
|
| +final _ScheduleImmediateHelper _scheduleImmediateHelper =
|
| + new _ScheduleImmediateHelper();
|
| +
|
| +get _scheduleImmediateClosure => (void callback()) {
|
| + _scheduleImmediateHelper._schedule(callback);
|
| +};
|
| +
|
| +get _pureIsolateScheduleImmediateClosure => ((void callback()) =>
|
| + throw new UnimplementedError("scheduleMicrotask in background isolates "
|
| + "are not supported in the browser"));
|
| +
|
| void _initializeCustomElement(Element e) {
|
| _Utils.initializeCustomElement(e);
|
| }
|
|
|