Rename Observatory to VMService (#5349)
This commit is contained in:
@@ -16,7 +16,7 @@ import '../build_info.dart';
|
||||
import '../device.dart';
|
||||
import '../flx.dart' as flx;
|
||||
import '../globals.dart';
|
||||
import '../observatory.dart';
|
||||
import '../vmservice.dart';
|
||||
import '../protocol_discovery.dart';
|
||||
import 'adb.dart';
|
||||
import 'android.dart';
|
||||
@@ -421,7 +421,7 @@ class AndroidDevice extends Device {
|
||||
ApplicationPackage package,
|
||||
LaunchResult result, {
|
||||
String mainPath,
|
||||
Observatory observatory
|
||||
VMService observatory
|
||||
}) async {
|
||||
Directory tempDir = await Directory.systemTemp.createTemp('flutter_tools');
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../cache.dart';
|
||||
import '../device.dart';
|
||||
import '../globals.dart';
|
||||
import '../hot.dart';
|
||||
import '../observatory.dart';
|
||||
import '../vmservice.dart';
|
||||
import '../resident_runner.dart';
|
||||
import '../run.dart';
|
||||
import '../runner/flutter_command.dart';
|
||||
@@ -275,7 +275,7 @@ Future<int> startApp(
|
||||
printError('Error running application on ${device.name}.');
|
||||
} else if (traceStartup) {
|
||||
try {
|
||||
Observatory observatory = await Observatory.connect(result.observatoryPort);
|
||||
VMService observatory = await VMService.connect(result.observatoryPort);
|
||||
await downloadStartupTrace(observatory);
|
||||
} catch (error) {
|
||||
printError('Error downloading trace from observatory: $error');
|
||||
|
||||
@@ -10,7 +10,7 @@ import '../base/common.dart';
|
||||
import '../base/utils.dart';
|
||||
import '../cache.dart';
|
||||
import '../globals.dart';
|
||||
import '../observatory.dart';
|
||||
import '../vmservice.dart';
|
||||
import '../runner/flutter_command.dart';
|
||||
|
||||
// Names of some of the Timeline events we care about.
|
||||
@@ -98,10 +98,10 @@ class Tracing {
|
||||
Tracing(this.observatory);
|
||||
|
||||
static Future<Tracing> connect(int port) {
|
||||
return Observatory.connect(port).then((Observatory observatory) => new Tracing(observatory));
|
||||
return VMService.connect(port).then((VMService observatory) => new Tracing(observatory));
|
||||
}
|
||||
|
||||
final Observatory observatory;
|
||||
final VMService observatory;
|
||||
|
||||
Future<Null> startTracing() async {
|
||||
await observatory.setVMTimelineFlags(<String>['Compiler', 'Dart', 'Embedder', 'GC']);
|
||||
@@ -153,7 +153,7 @@ class Tracing {
|
||||
|
||||
/// Download the startup trace information from the given observatory client and
|
||||
/// store it to build/start_up_info.json.
|
||||
Future<Null> downloadStartupTrace(Observatory observatory) async {
|
||||
Future<Null> downloadStartupTrace(VMService observatory) async {
|
||||
File traceInfoFile = new File('build/start_up_info.json');
|
||||
|
||||
if (await traceInfoFile.exists())
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'base/logger.dart';
|
||||
import 'dart/package_map.dart';
|
||||
import 'asset.dart';
|
||||
import 'globals.dart';
|
||||
import 'observatory.dart';
|
||||
import 'vmservice.dart';
|
||||
|
||||
typedef void DevFSProgressReporter(int progress, int max);
|
||||
|
||||
@@ -108,7 +108,7 @@ abstract class DevFSOperations {
|
||||
/// An implementation of [DevFSOperations] that speaks to the
|
||||
/// service protocol.
|
||||
class ServiceProtocolDevFSOperations implements DevFSOperations {
|
||||
final Observatory serviceProtocol;
|
||||
final VMService serviceProtocol;
|
||||
|
||||
ServiceProtocolDevFSOperations(this.serviceProtocol);
|
||||
|
||||
@@ -165,7 +165,7 @@ class ServiceProtocolDevFSOperations implements DevFSOperations {
|
||||
}
|
||||
|
||||
class _DevFSHttpWriter {
|
||||
_DevFSHttpWriter(this.fsName, Observatory serviceProtocol)
|
||||
_DevFSHttpWriter(this.fsName, VMService serviceProtocol)
|
||||
: httpAddress = serviceProtocol.httpAddress;
|
||||
|
||||
final String fsName;
|
||||
@@ -230,7 +230,7 @@ class _DevFSHttpWriter {
|
||||
|
||||
class DevFS {
|
||||
/// Create a [DevFS] named [fsName] for the local files in [directory].
|
||||
DevFS(Observatory serviceProtocol,
|
||||
DevFS(VMService serviceProtocol,
|
||||
String fsName,
|
||||
this.rootDirectory)
|
||||
: _operations = new ServiceProtocolDevFSOperations(serviceProtocol),
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'base/os.dart';
|
||||
import 'base/utils.dart';
|
||||
import 'build_info.dart';
|
||||
import 'globals.dart';
|
||||
import 'observatory.dart';
|
||||
import 'vmservice.dart';
|
||||
import 'ios/devices.dart';
|
||||
import 'ios/simulators.dart';
|
||||
|
||||
@@ -209,7 +209,7 @@ abstract class Device {
|
||||
ApplicationPackage package,
|
||||
LaunchResult result, {
|
||||
String mainPath,
|
||||
Observatory observatory
|
||||
VMService observatory
|
||||
}) async {
|
||||
throw 'unsupported';
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import 'dart/package_map.dart';
|
||||
import 'device.dart';
|
||||
import 'globals.dart';
|
||||
import 'devfs.dart';
|
||||
import 'observatory.dart';
|
||||
import 'vmservice.dart';
|
||||
import 'resident_runner.dart';
|
||||
import 'toolchain.dart';
|
||||
import 'view.dart';
|
||||
@@ -108,7 +108,7 @@ class FirstFrameTimer {
|
||||
return stopwatch.elapsed;
|
||||
}
|
||||
|
||||
final Observatory serviceProtocol;
|
||||
final VMService serviceProtocol;
|
||||
final Stopwatch stopwatch = new Stopwatch();
|
||||
final Completer<Null> _completer = new Completer<Null>();
|
||||
StreamSubscription<Event> _subscription;
|
||||
|
||||
@@ -12,7 +12,7 @@ import '../base/process.dart';
|
||||
import '../build_info.dart';
|
||||
import '../device.dart';
|
||||
import '../globals.dart';
|
||||
import '../observatory.dart';
|
||||
import '../vmservice.dart';
|
||||
import '../protocol_discovery.dart';
|
||||
import 'mac.dart';
|
||||
|
||||
@@ -328,7 +328,7 @@ class IOSDevice extends Device {
|
||||
ApplicationPackage package,
|
||||
LaunchResult result, {
|
||||
String mainPath,
|
||||
Observatory observatory
|
||||
VMService observatory
|
||||
}) async {
|
||||
throw 'unsupported';
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'base/logger.dart';
|
||||
import 'build_info.dart';
|
||||
import 'device.dart';
|
||||
import 'globals.dart';
|
||||
import 'observatory.dart';
|
||||
import 'vmservice.dart';
|
||||
import 'view.dart';
|
||||
|
||||
// Shared code between different resident application runners.
|
||||
@@ -28,7 +28,7 @@ abstract class ResidentRunner {
|
||||
final bool usesTerminalUI;
|
||||
final Completer<int> _finished = new Completer<int>();
|
||||
|
||||
Observatory serviceProtocol;
|
||||
VMService serviceProtocol;
|
||||
ViewManager viewManager;
|
||||
StreamSubscription<String> _loggingSubscription;
|
||||
|
||||
@@ -89,7 +89,7 @@ abstract class ResidentRunner {
|
||||
if (!debuggingOptions.debuggingEnabled) {
|
||||
return new Future<Null>.error('Error the service protocol is not enabled.');
|
||||
}
|
||||
serviceProtocol = await Observatory.connect(port);
|
||||
serviceProtocol = await VMService.connect(port);
|
||||
printTrace('Connected to service protocol on port $port');
|
||||
serviceProtocol.populateIsolateInfo();
|
||||
serviceProtocol.onExtensionEvent.listen((Event event) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'commands/install.dart';
|
||||
import 'commands/trace.dart';
|
||||
import 'device.dart';
|
||||
import 'globals.dart';
|
||||
import 'observatory.dart';
|
||||
import 'vmservice.dart';
|
||||
import 'resident_runner.dart';
|
||||
|
||||
class RunAndStayResident extends ResidentRunner {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'globals.dart';
|
||||
import 'observatory.dart';
|
||||
import 'vmservice.dart';
|
||||
|
||||
/// Peered to a Android/iOS FlutterView widget on a device.
|
||||
class FlutterView {
|
||||
@@ -41,7 +41,7 @@ class FlutterView {
|
||||
class ViewManager {
|
||||
ViewManager(this.serviceProtocol);
|
||||
|
||||
final Observatory serviceProtocol;
|
||||
final VMService serviceProtocol;
|
||||
|
||||
Future<Null> refresh() async {
|
||||
List<Map<String, String>> viewList = await serviceProtocol.getViewList();
|
||||
|
||||
@@ -12,8 +12,8 @@ import 'package:web_socket_channel/io.dart';
|
||||
import 'globals.dart';
|
||||
|
||||
// TODO(johnmccutchan): Rename this class to ServiceProtocol or VmService.
|
||||
class Observatory {
|
||||
Observatory._(this.peer, this.port, this.httpAddress) {
|
||||
class VMService {
|
||||
VMService._(this.peer, this.port, this.httpAddress) {
|
||||
peer.registerMethod('streamNotify', (rpc.Parameters event) {
|
||||
_handleStreamNotify(event.asMap);
|
||||
});
|
||||
@@ -28,13 +28,13 @@ class Observatory {
|
||||
});
|
||||
}
|
||||
|
||||
static Future<Observatory> connect(int port) async {
|
||||
static Future<VMService> connect(int port) async {
|
||||
Uri uri = new Uri(scheme: 'ws', host: '127.0.0.1', port: port, path: 'ws');
|
||||
WebSocket ws = await WebSocket.connect(uri.toString());
|
||||
rpc.Peer peer = new rpc.Peer(new IOWebSocketChannel(ws));
|
||||
peer.listen();
|
||||
Uri httpAddress = new Uri(scheme: 'http', host: '127.0.0.1', port: port);
|
||||
return new Observatory._(peer, port, httpAddress);
|
||||
return new VMService._(peer, port, httpAddress);
|
||||
}
|
||||
final Uri httpAddress;
|
||||
final rpc.Peer peer;
|
||||
Reference in New Issue
Block a user