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

Side by Side Diff: sdk/lib/vmservice/vmservice.dart

Issue 1998963003: Rework standalone to use a synchronous loader that does not invoke Dart code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« runtime/bin/builtin.dart ('K') | « runtime/vm/service_isolate.cc ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart._vmservice; 5 library dart._vmservice;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:isolate'; 10 import 'dart:isolate';
11 import 'dart:typed_data'; 11 import 'dart:typed_data';
12 12
13 part 'asset.dart'; 13 part 'asset.dart';
14 part 'client.dart'; 14 part 'client.dart';
15 part 'constants.dart'; 15 part 'constants.dart';
16 part 'running_isolate.dart'; 16 part 'running_isolate.dart';
17 part 'running_isolates.dart'; 17 part 'running_isolates.dart';
18 part 'message.dart'; 18 part 'message.dart';
19 part 'message_router.dart'; 19 part 'message_router.dart';
20 20
21 final RawReceivePort isolateLifecyclePort = new RawReceivePort(); 21 final RawReceivePort isolateLifecyclePort = new RawReceivePort();
22 final RawReceivePort scriptLoadPort = new RawReceivePort(); 22 final RawReceivePort scriptLoadPort = new RawReceivePort();
23 23
24 // This is for use by the embedder. It is a map from the isolateId to
25 // anything. When an isolate goes away, it will be removed from this map.
26 final Map<int, dynamic> isolateEmbedderData = new Map<int, dynamic>();
27
24 // These must be kept in sync with the declarations in vm/json_stream.h. 28 // These must be kept in sync with the declarations in vm/json_stream.h.
25 const kInvalidParams = -32602; 29 const kInvalidParams = -32602;
26 const kInternalError = -32603; 30 const kInternalError = -32603;
27 const kStreamAlreadySubscribed = 103; 31 const kStreamAlreadySubscribed = 103;
28 const kStreamNotSubscribed = 104; 32 const kStreamNotSubscribed = 104;
29 33
30 var _errorMessages = { 34 var _errorMessages = {
31 kInvalidParams: 'Invalid params', 35 kInvalidParams: 'Invalid params',
32 kInternalError: 'Internal error', 36 kInternalError: 'Internal error',
33 kStreamAlreadySubscribed: 'Stream already subscribed', 37 kStreamAlreadySubscribed: 'Stream already subscribed',
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 void _controlMessageHandler(int code, 121 void _controlMessageHandler(int code,
118 int portId, 122 int portId,
119 SendPort sp, 123 SendPort sp,
120 String name) { 124 String name) {
121 switch (code) { 125 switch (code) {
122 case Constants.ISOLATE_STARTUP_MESSAGE_ID: 126 case Constants.ISOLATE_STARTUP_MESSAGE_ID:
123 runningIsolates.isolateStartup(portId, sp, name); 127 runningIsolates.isolateStartup(portId, sp, name);
124 break; 128 break;
125 case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID: 129 case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID:
126 runningIsolates.isolateShutdown(portId, sp); 130 runningIsolates.isolateShutdown(portId, sp);
131 isolateEmbedderData.remove(portId);
127 break; 132 break;
128 } 133 }
129 } 134 }
130 135
131 Future _exit() async { 136 Future _exit() async {
132 // Stop the server. 137 // Stop the server.
133 if (VMServiceEmbedderHooks.serverStop != null) { 138 if (VMServiceEmbedderHooks.serverStop != null) {
134 await VMServiceEmbedderHooks.serverStop(); 139 await VMServiceEmbedderHooks.serverStop();
135 } 140 }
136 141
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 external void onServerAddressChange(String address); 338 external void onServerAddressChange(String address);
334 339
335 /// Subscribe to a service stream. 340 /// Subscribe to a service stream.
336 external bool _vmListenStream(String streamId); 341 external bool _vmListenStream(String streamId);
337 342
338 /// Cancel a subscription to a service stream. 343 /// Cancel a subscription to a service stream.
339 external void _vmCancelStream(String streamId); 344 external void _vmCancelStream(String streamId);
340 345
341 /// Get the bytes to the tar archive. 346 /// Get the bytes to the tar archive.
342 external Uint8List _requestAssets(); 347 external Uint8List _requestAssets();
OLDNEW
« runtime/bin/builtin.dart ('K') | « runtime/vm/service_isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698