OLD | NEW |
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'; | |
11 | 10 |
12 part 'client.dart'; | 11 part 'client.dart'; |
13 part 'constants.dart'; | 12 part 'constants.dart'; |
14 part 'running_isolate.dart'; | 13 part 'running_isolate.dart'; |
15 part 'running_isolates.dart'; | 14 part 'running_isolates.dart'; |
16 part 'message.dart'; | 15 part 'message.dart'; |
17 part 'message_router.dart'; | 16 part 'message_router.dart'; |
18 | 17 |
19 final RawReceivePort isolateLifecyclePort = new RawReceivePort(); | 18 final RawReceivePort isolateLifecyclePort = new RawReceivePort(); |
20 final RawReceivePort scriptLoadPort = new RawReceivePort(); | 19 final RawReceivePort scriptLoadPort = new RawReceivePort(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 assert(message is List); | 98 assert(message is List); |
100 if (message is List && message.length == 4) { | 99 if (message is List && message.length == 4) { |
101 _controlMessageHandler(message[0], message[1], message[2], message[3]); | 100 _controlMessageHandler(message[0], message[1], message[2], message[3]); |
102 } else if (message is List && message.length == 2) { | 101 } else if (message is List && message.length == 2) { |
103 _eventMessageHandler(message[0], message[1]); | 102 _eventMessageHandler(message[0], message[1]); |
104 } else { | 103 } else { |
105 Logger.root.severe('Unexpected message: $message'); | 104 Logger.root.severe('Unexpected message: $message'); |
106 } | 105 } |
107 } | 106 } |
108 | 107 |
| 108 void _notSupported(_) { |
| 109 throw new UnimplementedError('Service script loading not supported.'); |
| 110 } |
| 111 |
109 VMService._internal() | 112 VMService._internal() |
110 : eventPort = isolateLifecyclePort { | 113 : eventPort = isolateLifecyclePort { |
| 114 scriptLoadPort.handler = _notSupported; |
111 eventPort.handler = messageHandler; | 115 eventPort.handler = messageHandler; |
112 } | 116 } |
113 | 117 |
114 factory VMService() { | 118 factory VMService() { |
115 if (VMService._instance == null) { | 119 if (VMService._instance == null) { |
116 VMService._instance = new VMService._internal(); | 120 VMService._instance = new VMService._internal(); |
117 _onStart(); | 121 _onStart(); |
118 } | 122 } |
119 return _instance; | 123 return _instance; |
120 } | 124 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 156 |
153 void _registerIsolate(int port_id, SendPort sp, String name) { | 157 void _registerIsolate(int port_id, SendPort sp, String name) { |
154 var service = new VMService(); | 158 var service = new VMService(); |
155 service.runningIsolates.isolateStartup(port_id, sp, name); | 159 service.runningIsolates.isolateStartup(port_id, sp, name); |
156 } | 160 } |
157 | 161 |
158 void _setEventMask(int mask) | 162 void _setEventMask(int mask) |
159 native "VMService_SetEventMask"; | 163 native "VMService_SetEventMask"; |
160 | 164 |
161 void _onStart() native "VMService_OnStart"; | 165 void _onStart() native "VMService_OnStart"; |
OLD | NEW |