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

Unified Diff: pkg/analysis_server/lib/src/domain_server.dart

Issue 243753002: Analysis server context ID is now specified by the client. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domain_server.dart
diff --git a/pkg/analysis_server/lib/src/domain_server.dart b/pkg/analysis_server/lib/src/domain_server.dart
index 40b0205088cb818a8758f437502dba0a090bc33f..eb1f3f8cdda1e162ff0b516f3bbf8e0d04cb9e3c 100644
--- a/pkg/analysis_server/lib/src/domain_server.dart
+++ b/pkg/analysis_server/lib/src/domain_server.dart
@@ -53,11 +53,6 @@ class ServerDomainHandler implements RequestHandler {
static const String SDK_DIRECTORY_PARAM = 'sdkDirectory';
/**
- * The name of the contextId result value.
- */
- static const String CONTEXT_ID_RESULT = 'contextId';
-
- /**
* The name of the version result value.
*/
static const String VERSION_RESULT = 'version';
@@ -100,11 +95,9 @@ class ServerDomainHandler implements RequestHandler {
String sdkDirectory = request.getRequiredParameter(SDK_DIRECTORY_PARAM);
Map<String, String> packageMap = request.getParameter(PACKAGE_MAP_PARAM);
- String baseContextId = new DateTime.now().millisecondsSinceEpoch.toRadixString(16);
- String contextId = baseContextId;
- int index = 1;
- while (server.contextMap.containsKey(contextId)) {
- contextId = '$baseContextId-$index';
+ String contextId = request.getParameter(CONTEXT_ID_PARAM);
Brian Wilkerson 2014/04/18 21:58:25 I think this should use getRequiredParameter. We
Paul Berry 2014/04/18 22:21:19 Done.
+ if (server.contextMap.containsKey(contextId)) {
+ return new Response.contextAlreadyExists(request);
}
AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
// TODO(brianwilkerson) Use the information from the request to set the
@@ -125,7 +118,6 @@ class ServerDomainHandler implements RequestHandler {
server.contextMap[contextId] = context;
Response response = new Response(request.id);
- response.setResult(CONTEXT_ID_RESULT, contextId);
return response;
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698