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

Side by Side Diff: pkg/analyzer_plugin/lib/src/driver.dart

Issue 2667823003: Add top-level driver and abstract plugin superclass (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:isolate';
6
7 import 'package:analyzer_plugin/plugin/plugin.dart';
8 import 'package:analyzer_plugin/src/channel/isolate_channel.dart';
9 import 'package:analyzer_plugin/starter.dart';
10
11 /**
12 * The [Driver] class represents a single running instance of an analysis
13 * server plugin. It is responsible for handling the communications with the
14 * server and forwarding requests on to the plugin.
15 */
16 class Driver implements ServerPluginStarter {
17 /**
18 * The plugin that will be started.
19 */
20 final ServerPlugin plugin;
21
22 /**
23 * Initialize a newly created driver that can be used to start the given
24 * plugin.
25 */
26 Driver(this.plugin);
27
28 @override
29 void start(SendPort sendPort) {
30 IsolateChannel channel = new IsolateChannel(sendPort);
31 plugin.start(channel);
32 }
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698