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

Side by Side Diff: pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart

Issue 2986123002: Prevent exception with isolate failed to start (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « no previous file | 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 8
9 import 'package:analyzer/instrumentation/instrumentation.dart'; 9 import 'package:analyzer/instrumentation/instrumentation.dart';
10 import 'package:analyzer_plugin/channel/channel.dart'; 10 import 'package:analyzer_plugin/channel/channel.dart';
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 instrumentationService.logPluginNotification(pluginId, encodedInput); 273 instrumentationService.logPluginNotification(pluginId, encodedInput);
274 onNotification(new Notification.fromJson(input)); 274 onNotification(new Notification.fromJson(input));
275 } 275 }
276 } 276 }
277 }); 277 });
278 return channelReady.future; 278 return channelReady.future;
279 } 279 }
280 280
281 @override 281 @override
282 void sendRequest(Request request) { 282 void sendRequest(Request request) {
283 Map<String, Object> json = request.toJson(); 283 if (_sendPort != null) {
284 String encodedRequest = JSON.encode(json); 284 Map<String, Object> json = request.toJson();
285 instrumentationService.logPluginRequest(pluginId, encodedRequest); 285 String encodedRequest = JSON.encode(json);
286 _sendPort.send(json); 286 instrumentationService.logPluginRequest(pluginId, encodedRequest);
287 _sendPort.send(json);
288 }
287 } 289 }
288 290
289 /** 291 /**
290 * Spawn the isolate in which the plugin is running. 292 * Spawn the isolate in which the plugin is running.
291 */ 293 */
292 Future<Isolate> _spawnIsolate(); 294 Future<Isolate> _spawnIsolate();
293 } 295 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698