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

Unified Diff: runtime/bin/vmservice/server.dart

Issue 2738373003: [Fuchsia] vmservice creates a file in /tmp named with its port. (Closed)
Patch Set: Use sync file ops Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/server.dart
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index 34bf43e534cf0f6a9edf909da42bc378b96f9882..d4aa5aa49a31f2658e5f68267d9b739dee764ae4 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -344,6 +344,13 @@ class Server {
_server = await HttpServer.bind(address, _port);
_server.listen(_requestHandler, cancelOnError: true);
serverPrint('Observatory listening on $serverAddress');
+ if (Platform.isFuchsia) {
+ // Create a file with the port number.
+ String tmp = Directory.systemTemp.path;
+ String path = "$tmp/dart.services/${_server.port}";
+ serverPrint("Creating $path");
+ new File(path)..createSync(recursive: true);
+ }
// Server is up and running.
_notifyServerState(serverAddress.toString());
onServerAddressChange('$serverAddress');
@@ -360,6 +367,13 @@ class Server {
if (_server == null) {
return new Future.value(null);
}
+ if (Platform.isFuchsia) {
+ // Remove the file with the port number.
+ String tmp = Directory.systemTemp.path;
+ String path = "$tmp/dart.services/${_server.port}";
+ serverPrint("Deleting $path");
+ new File(path)..deleteSync();
+ }
return _server.close(force: force);
}
« 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