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

Unified Diff: pkg/analyzer/lib/instrumentation/instrumentation.dart

Issue 2359233002: Add support for getting the sessionId from instrumentation and sending it to the client (Closed)
Patch Set: Created 4 years, 3 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
Index: pkg/analyzer/lib/instrumentation/instrumentation.dart
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
index eaf95ba56e87dcb58533c1c65fffc63c39c11de9..abc2799315e8927bd90df7a6999f164dedddb0e3 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -23,6 +23,11 @@ class AnalysisPerformanceKind {
*/
abstract class InstrumentationServer {
/**
+ * Return the identifier used to identify the current session.
+ */
+ String get sessionId;
+
+ /**
* Pass the given [message] to the instrumentation server so that it will be
* logged with other messages.
*
@@ -96,6 +101,11 @@ class InstrumentationService {
bool get isActive => _instrumentationServer != null;
/**
+ * Return the identifier used to identify the current session.
+ */
+ String get sessionId => _instrumentationServer?.sessionId ?? '';
+
+ /**
* The current time, expressed as a decimal encoded number of milliseconds.
*/
String get _timestamp => new DateTime.now().millisecondsSinceEpoch.toString();
@@ -357,6 +367,9 @@ class MulticastInstrumentationServer implements InstrumentationServer {
MulticastInstrumentationServer(this._servers);
@override
+ String get sessionId => _servers[0].sessionId;
+
+ @override
void log(String message) {
for (InstrumentationServer server in _servers) {
server.log(message);

Powered by Google App Engine
This is Rietveld 408576698