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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 98183006: Fixing Window.animationFrame timing issue (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_Window.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 be4fb4fc59932c2cff8b16e1189b08a22b52ccba..59a84f6a0510f72788418b7eb4e46fecd9756e8c 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -27952,13 +27952,13 @@ class Url extends NativeFieldWrapperClass2 {
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");
@@ -28555,7 +28555,7 @@ class Window extends EventTarget implements WindowBase, _WindowTimers, WindowBas
* [animationFrame] again for the animation to continue.
*/
Future<num> get animationFrame {
- var completer = new Completer<num>();
+ var completer = new Completer<num>.sync();
requestAnimationFrame((time) {
completer.complete(time);
});
@@ -37055,26 +37055,26 @@ final _pureIsolateUriBaseClosure = () {
};
class _Timer implements Timer {
- const int _STATE_TIMEOUT = 0;
- const int _STATE_INTERVAL = 1;
- var _state;
+ static const int _STATE_TIMEOUT = 0;
+ static const int _STATE_INTERVAL = 1;
+ int _state;
_Timer(int milliSeconds, void callback(Timer timer), bool repeating) {
if (repeating) {
- _state = window._setInterval(() {
+ _state = (window._setInterval(() {
callback(this);
- }, milliSeconds) * 2 + _STATE_INTERVAL;
+ }, milliSeconds) << 1) | _STATE_INTERVAL;
} else {
- _state = window._setTimeout(() {
+ _state = (window._setTimeout(() {
_state = null;
callback(this);
- }, milliSeconds) * 2 + _STATE_TIMEOUT;
+ }, milliSeconds) << 1) | _STATE_TIMEOUT;
}
}
void cancel() {
if (_state == null) return;
- int id = _state ~/ 2;
+ int id = _state >> 1;
if ((_state & 1) == _STATE_TIMEOUT) {
window._clearTimeout(id);
} else {
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_Window.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698