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'; | 10 import 'dart:typed_data'; |
(...skipping 28 matching lines...) Expand all Loading... |
39 clients.add(client); | 39 clients.add(client); |
40 } | 40 } |
41 | 41 |
42 void _removeClient(Client client) { | 42 void _removeClient(Client client) { |
43 clients.remove(client); | 43 clients.remove(client); |
44 } | 44 } |
45 | 45 |
46 void _eventMessageHandler(dynamic eventMessage) { | 46 void _eventMessageHandler(dynamic eventMessage) { |
47 for (var client in clients) { | 47 for (var client in clients) { |
48 if (client.sendEvents) { | 48 if (client.sendEvents) { |
49 client.post(null, eventMessage); | 49 client.post(eventMessage); |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 void _controlMessageHandler(int code, | 54 void _controlMessageHandler(int code, |
55 int portId, | 55 int portId, |
56 SendPort sp, | 56 SendPort sp, |
57 String name) { | 57 String name) { |
58 switch (code) { | 58 switch (code) { |
59 case Constants.ISOLATE_STARTUP_MESSAGE_ID: | 59 case Constants.ISOLATE_STARTUP_MESSAGE_ID: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 void _registerIsolate(int port_id, SendPort sp, String name) { | 164 void _registerIsolate(int port_id, SendPort sp, String name) { |
165 var service = new VMService(); | 165 var service = new VMService(); |
166 service.runningIsolates.isolateStartup(port_id, sp, name); | 166 service.runningIsolates.isolateStartup(port_id, sp, name); |
167 } | 167 } |
168 | 168 |
169 void _onStart() native "VMService_OnStart"; | 169 void _onStart() native "VMService_OnStart"; |
170 | 170 |
171 void _onExit() native "VMService_OnExit"; | 171 void _onExit() native "VMService_OnExit"; |
OLD | NEW |