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

Side by Side Diff: runtime/lib/isolate_patch.dart

Issue 825403003: Fix http://dartbug.com/21834 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/internal_patch.dart ('k') | sdk/lib/io/timer_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:collection" show HashMap; 5 import "dart:collection" show HashMap;
6 import "dart:_internal";
6 7
7 patch class ReceivePort { 8 patch class ReceivePort {
8 /* patch */ factory ReceivePort() = _ReceivePortImpl; 9 /* patch */ factory ReceivePort() = _ReceivePortImpl;
9 10
10 /* patch */ factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) = 11 /* patch */ factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) =
11 _ReceivePortImpl.fromRawReceivePort; 12 _ReceivePortImpl.fromRawReceivePort;
12 } 13 }
13 14
14 patch class Capability { 15 patch class Capability {
15 /* patch */ factory Capability() = _CapabilityImpl; 16 /* patch */ factory Capability() = _CapabilityImpl;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return result; 134 return result;
134 } 135 }
135 136
136 // Called from the VM to dispatch to the handler. 137 // Called from the VM to dispatch to the handler.
137 static void _handleMessage(Function handler, var message) { 138 static void _handleMessage(Function handler, var message) {
138 // TODO(floitsch): this relies on the fact that any exception aborts the 139 // TODO(floitsch): this relies on the fact that any exception aborts the
139 // VM. Once we have non-fatal global exceptions we need to catch errors 140 // VM. Once we have non-fatal global exceptions we need to catch errors
140 // so that we can run the immediate callbacks. 141 // so that we can run the immediate callbacks.
141 handler(message); 142 handler(message);
142 _runPendingImmediateCallback(); 143 _runPendingImmediateCallback();
144
145 // Event was handled. Now run expired timers.
146 if (runTimerClosure != null) {
147 runTimerClosure(_runPendingImmediateCallback);
148 }
143 } 149 }
144 150
145 // Call into the VM to close the VM maintained mappings. 151 // Call into the VM to close the VM maintained mappings.
146 _closeInternal() native "RawReceivePortImpl_closeInternal"; 152 _closeInternal() native "RawReceivePortImpl_closeInternal";
147 153
148 void set handler(Function value) { 154 void set handler(Function value) {
149 _handlerMap[this._get_id()] = value; 155 _handlerMap[this._get_id()] = value;
150 } 156 }
151 157
152 // TODO(iposva): Ideally keep this map in the VM. 158 // TODO(iposva): Ideally keep this map in the VM.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 static Isolate _getCurrentIsolate() { 412 static Isolate _getCurrentIsolate() {
407 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); 413 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate();
408 return new Isolate(portAndCapabilities[0], 414 return new Isolate(portAndCapabilities[0],
409 pauseCapability: portAndCapabilities[1], 415 pauseCapability: portAndCapabilities[1],
410 terminateCapability: portAndCapabilities[2]); 416 terminateCapability: portAndCapabilities[2]);
411 } 417 }
412 418
413 static List _getPortAndCapabilitiesOfCurrentIsolate() 419 static List _getPortAndCapabilitiesOfCurrentIsolate()
414 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; 420 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate";
415 } 421 }
OLDNEW
« no previous file with comments | « runtime/lib/internal_patch.dart ('k') | sdk/lib/io/timer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698