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

Side by Side Diff: lib/async/async_patch.dart

Issue 1450393002: Roll sdk dependency to 34357cdad108dcba734949bd13bd28c76ea285e0 (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'dart:fletch._system' as fletch; 5 import 'dart:fletch._system' as fletch;
6 import 'dart:fletch._system' show patch;
6 import 'dart:fletch'; 7 import 'dart:fletch';
7 import 'dart:fletch.os' as os; 8 import 'dart:fletch.os' as os;
8 import 'dart:math'; 9 import 'dart:math';
9 10
10 const patch = "patch";
11
12 Channel _eventQueue; 11 Channel _eventQueue;
13 int _numberOfEvents = 0; 12 int _numberOfEvents = 0;
14 13
15 void _handleEvents() { 14 void _handleEvents() {
16 while (_numberOfEvents > 0) { 15 while (_numberOfEvents > 0) {
17 var event = _eventQueue.receive(); 16 var event = _eventQueue.receive();
18 _numberOfEvents--; 17 _numberOfEvents--;
19 event(); 18 event();
20 } 19 }
21 _eventQueue = null; 20 _eventQueue = null;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 107 }
109 108
110 @patch static Timer _createPeriodicTimer(Duration duration, 109 @patch static Timer _createPeriodicTimer(Duration duration,
111 void callback(Timer timer)) { 110 void callback(Timer timer)) {
112 int milliseconds = max(0, duration.inMilliseconds); 111 int milliseconds = max(0, duration.inMilliseconds);
113 return new _FletchTimer.periodic(_currentTimestamp + milliseconds, 112 return new _FletchTimer.periodic(_currentTimestamp + milliseconds,
114 callback, 113 callback,
115 milliseconds); 114 milliseconds);
116 } 115 }
117 } 116 }
117
118 @patch void _rethrow(Object error, StackTrace stackTrace) {
119 throw new AsyncError(error, stackTrace);
120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698