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

Side by Side Diff: runtime/bin/vmservice/vmservice.dart

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmservice/running_isolate.dart ('k') | runtime/lib/isolate.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library vmservice; 5 library vmservice;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import "dart:convert"; 8 import "dart:convert";
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:typed_data'; 10 import 'dart:typed_data';
(...skipping 13 matching lines...) Expand all
24 switch (code) { 24 switch (code) {
25 case Constants.ISOLATE_STARTUP_MESSAGE_ID: 25 case Constants.ISOLATE_STARTUP_MESSAGE_ID:
26 runningIsolates.isolateStartup(sp, name); 26 runningIsolates.isolateStartup(sp, name);
27 break; 27 break;
28 case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID: 28 case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID:
29 runningIsolates.isolateShutdown(sp); 29 runningIsolates.isolateShutdown(sp);
30 break; 30 break;
31 } 31 }
32 } 32 }
33 33
34 void messageHandler(message, SendPort replyTo) { 34 void messageHandler(message) {
35 if (message is List && message.length == 3) { 35 if (message is List && message.length == 3) {
36 controlMessageHandler(message[0], message[1], message[2]); 36 controlMessageHandler(message[0], message[1], message[2]);
37 } 37 }
38 } 38 }
39 39
40 VMService._internal() { 40 VMService._internal() {
41 port.receive(messageHandler); 41 port.listen(messageHandler);
42 } 42 }
43 43
44 factory VMService() { 44 factory VMService() {
45 if (VMService._instance == null) { 45 if (VMService._instance == null) {
46 VMService._instance = new VMService._internal(); 46 VMService._instance = new VMService._internal();
47 } 47 }
48 return _instance; 48 return _instance;
49 } 49 }
50 } 50 }
51 51
52 void sendServiceMessage(SendPort sp, ReceivePort rp, Object m) 52 void sendServiceMessage(SendPort sp, ReceivePort rp, Object m)
53 native "SendServiceMessage"; 53 native "SendServiceMessage";
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/running_isolate.dart ('k') | runtime/lib/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698