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

Unified Diff: pkg/analysis_server/lib/plugin/protocol/generated_protocol.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
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | 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/plugin/protocol/generated_protocol.dart
diff --git a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
index ce67998f1fe43ab673b7694bd49b13992a4ef89e..f3c2d98a8556fd5558227675900765721c546a7f 100644
--- a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
+++ b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
@@ -267,6 +267,7 @@ class ServerSetSubscriptionsResult {
* {
* "version": String
* "pid": int
+ * "sessionId": optional String
* }
*
* Clients may not extend, implement or mix-in this class.
@@ -276,6 +277,8 @@ class ServerConnectedParams implements HasToJson {
int _pid;
+ String _sessionId;
+
/**
* The version number of the analysis server.
*/
@@ -302,9 +305,22 @@ class ServerConnectedParams implements HasToJson {
this._pid = value;
}
- ServerConnectedParams(String version, int pid) {
+ /**
+ * The session id for this session.
+ */
+ String get sessionId => _sessionId;
+
+ /**
+ * The session id for this session.
+ */
+ void set sessionId(String value) {
+ this._sessionId = value;
+ }
+
+ ServerConnectedParams(String version, int pid, {String sessionId}) {
this.version = version;
this.pid = pid;
+ this.sessionId = sessionId;
}
factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
@@ -324,7 +340,11 @@ class ServerConnectedParams implements HasToJson {
} else {
throw jsonDecoder.missingKey(jsonPath, "pid");
}
- return new ServerConnectedParams(version, pid);
+ String sessionId;
+ if (json.containsKey("sessionId")) {
+ sessionId = jsonDecoder.decodeString(jsonPath + ".sessionId", json["sessionId"]);
+ }
+ return new ServerConnectedParams(version, pid, sessionId: sessionId);
} else {
throw jsonDecoder.mismatch(jsonPath, "server.connected params", json);
}
@@ -339,6 +359,9 @@ class ServerConnectedParams implements HasToJson {
Map<String, dynamic> result = {};
result["version"] = version;
result["pid"] = pid;
+ if (sessionId != null) {
+ result["sessionId"] = sessionId;
+ }
return result;
}
@@ -353,7 +376,8 @@ class ServerConnectedParams implements HasToJson {
bool operator==(other) {
if (other is ServerConnectedParams) {
return version == other.version &&
- pid == other.pid;
+ pid == other.pid &&
+ sessionId == other.sessionId;
}
return false;
}
@@ -363,6 +387,7 @@ class ServerConnectedParams implements HasToJson {
int hash = 0;
hash = JenkinsSmiHash.combine(hash, version.hashCode);
hash = JenkinsSmiHash.combine(hash, pid.hashCode);
+ hash = JenkinsSmiHash.combine(hash, sessionId.hashCode);
return JenkinsSmiHash.finish(hash);
}
}
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698