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

Unified Diff: runtime/lib/isolate_patch.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/integers_patch.dart ('k') | runtime/lib/math_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate_patch.dart
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index 03ec6648a3b763ec3324ea4ac4ac1f72d1e2f954..a521a636efe49da34dd3599ec4fcb471f96db368 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -85,7 +85,7 @@ class _SendPortImpl implements SendPort {
port.receive((value, ignoreReplyTo) {
port.close();
if (value is Exception) {
- completer.completeException(value);
+ completer.completeError(value);
} else {
completer.complete(value);
}
@@ -122,50 +122,17 @@ _getPortInternal() native "isolate_getPortInternal";
ReceivePort _portInternal;
-patch ReceivePort get port {
- if (_portInternal == null) {
- _portInternal = _getPortInternal();
- }
- return _portInternal;
-}
-
-patch spawnFunction(void topLevelFunction(),
- [bool UnhandledExceptionCallback(IsolateUnhandledException e)])
- native "isolate_spawnFunction";
-
-patch spawnUri(String uri) native "isolate_spawnUri";
-
-patch class Timer {
- /* patch */ factory Timer(int milliseconds, void callback(Timer timer)) {
- if (_TimerFactory._factory == null) {
- throw new UnsupportedError("Timer interface not supported.");
+patch class _Isolate {
+ /* patch */ static ReceivePort get port {
+ if (_portInternal == null) {
+ _portInternal = _getPortInternal();
}
- return _TimerFactory._factory(milliseconds, callback, false);
+ return _portInternal;
}
- /**
- * Creates a new repeating timer. The [callback] is invoked every
- * [milliseconds] millisecond until cancelled.
- */
- /* patch */ factory Timer.repeating(int milliseconds,
- void callback(Timer timer)) {
- if (_TimerFactory._factory == null) {
- throw new UnsupportedError("Timer interface not supported.");
- }
- return _TimerFactory._factory(milliseconds, callback, true);
- }
-}
-
-typedef Timer _TimerFactoryClosure(int milliseconds,
- void callback(Timer timer),
- bool repeating);
-
-class _TimerFactory {
- static _TimerFactoryClosure _factory;
-}
+ /* patch */ static spawnFunction(void topLevelFunction(),
+ [bool UnhandledExceptionCallback(IsolateUnhandledException e)])
+ native "isolate_spawnFunction";
-// TODO(ahe): Warning: this is NOT called by Dartium. Instead, it sets
-// [_TimerFactory._factory] directly.
-void _setTimerFactoryClosure(_TimerFactoryClosure closure) {
- _TimerFactory._factory = closure;
+ /* patch */ static spawnUri(String uri) native "isolate_spawnUri";
}
« no previous file with comments | « runtime/lib/integers_patch.dart ('k') | runtime/lib/math_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698