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

Unified Diff: pkg/analysis_server/lib/driver.dart

Issue 787763004: Hooks for instrumentation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/driver.dart
diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/driver.dart
index c81bb8982ce95be217b460f121b7b9153efdae5d..08d7bfac72635ac463412634eecd67266fb54cec 100644
--- a/pkg/analysis_server/lib/driver.dart
+++ b/pkg/analysis_server/lib/driver.dart
@@ -11,6 +11,7 @@ import 'package:analysis_server/http_server.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/socket_server.dart';
import 'package:analysis_server/stdio_server.dart';
+import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/src/generated/incremental_logger.dart';
import 'package:analyzer/src/generated/java_io.dart';
import 'package:analyzer/src/generated/sdk.dart';
@@ -114,6 +115,11 @@ class Driver {
*/
static const String NO_ERROR_NOTIFICATION = "no-error-notification";
+ /**
+ * The instrumentation server that is to be used by the analysis server.
+ */
+ InstrumentationServer instrumentationServer;
+
SocketServer socketServer;
HttpAnalysisServer httpServer;
@@ -173,15 +179,31 @@ class Driver {
_printUsage(parser);
return;
}
- if (results[ENABLE_INSTRUMENTATION_OPTION]) {
- if (results[INSTRUMENTATION_LOG_FILE_OPTION] != null) {
- // TODO(brianwilkerson) Initialize the instrumentation system with
- // logging.
- } else {
- // TODO(brianwilkerson) Initialize the instrumentation system without
- // logging.
- }
- }
+
+ // TODO(brianwilkerson) Enable this after it is possible for an
+ // instrumentation server to be provided.
+// if (results[ENABLE_INSTRUMENTATION_OPTION]) {
+//// if (results[INSTRUMENTATION_LOG_FILE_OPTION] != null) {
+//// // TODO(brianwilkerson) Initialize the instrumentation server with
+//// // logging.
+//// } else {
+//// // TODO(brianwilkerson) Initialize the instrumentation server without
+//// // logging.
+//// }
+// if (instrumentationServer == null) {
+// print('Exiting server: enabled instrumentation without providing an instrumentation server');
+// print('');
+// _printUsage(parser);
+// return;
+// }
+// } else {
+// if (instrumentationServer != null) {
+// print('Exiting server: providing an instrumentation server without enabling instrumentation');
+// print('');
+// _printUsage(parser);
+// return;
+// }
+// }
int port;
bool serve_http = false;
@@ -215,7 +237,12 @@ class Driver {
defaultSdk = DirectoryBasedDartSdk.defaultSdk;
}
- socketServer = new SocketServer(analysisServerOptions, defaultSdk);
+ socketServer = new SocketServer(
+ analysisServerOptions,
+ defaultSdk,
+ instrumentationServer == null ?
+ new NullInstrumentationServer() :
+ instrumentationServer);
httpServer = new HttpAnalysisServer(socketServer);
stdioServer = new StdioAnalysisServer(socketServer);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698