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

Side by Side Diff: pkg/analysis_server/lib/plugin/protocol/protocol.dart

Issue 1511833004: Validate that root paths are absolute and normalized. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Support for client code that needs to interact with the requests, responses 6 * Support for client code that needs to interact with the requests, responses
7 * and notifications that are part of the analysis server's wire protocol. 7 * and notifications that are part of the analysis server's wire protocol.
8 */ 8 */
9 library analysis_server.plugin.protocol.protocol; 9 library analysis_server.plugin.protocol.protocol;
10 10
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 * Initialize a newly created instance to represent an error condition caused 434 * Initialize a newly created instance to represent an error condition caused
435 * by a [request] that specifies an execution context whose context root does 435 * by a [request] that specifies an execution context whose context root does
436 * not exist. 436 * not exist.
437 */ 437 */
438 Response.invalidExecutionContext(Request request, String contextId) 438 Response.invalidExecutionContext(Request request, String contextId)
439 : this(request.id, 439 : this(request.id,
440 error: new RequestError(RequestErrorCode.INVALID_EXECUTION_CONTEXT, 440 error: new RequestError(RequestErrorCode.INVALID_EXECUTION_CONTEXT,
441 "Invalid execution context: $contextId")); 441 "Invalid execution context: $contextId"));
442 442
443 /** 443 /**
444 * Initialize a newly created instance to represent the
445 * INVALID_FILE_PATH_FORMAT error condition.
446 */
447 Response.invalidFilePathFormat(Request request, path)
448 : this(request.id,
449 error: new RequestError(RequestErrorCode.INVALID_FILE_PATH_FORMAT,
450 'Invalid file path format: $path'));
451
452 /**
444 * Initialize a newly created instance to represent an error condition caused 453 * Initialize a newly created instance to represent an error condition caused
445 * by a [request] that had invalid parameter. [path] is the path to the 454 * by a [request] that had invalid parameter. [path] is the path to the
446 * invalid parameter, in Javascript notation (e.g. "foo.bar" means that the 455 * invalid parameter, in Javascript notation (e.g. "foo.bar" means that the
447 * parameter "foo" contained a key "bar" whose value was the wrong type). 456 * parameter "foo" contained a key "bar" whose value was the wrong type).
448 * [expectation] is a description of the type of data that was expected. 457 * [expectation] is a description of the type of data that was expected.
449 */ 458 */
450 Response.invalidParameter(Request request, String path, String expectation) 459 Response.invalidParameter(Request request, String path, String expectation)
451 : this(request.id, 460 : this(request.id,
452 error: new RequestError(RequestErrorCode.INVALID_PARAMETER, 461 error: new RequestError(RequestErrorCode.INVALID_PARAMETER,
453 "Invalid parameter '$path'. $expectation.")); 462 "Invalid parameter '$path'. $expectation."));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 jsonObject[ID] = id; 575 jsonObject[ID] = id;
567 if (error != null) { 576 if (error != null) {
568 jsonObject[ERROR] = error.toJson(); 577 jsonObject[ERROR] = error.toJson();
569 } 578 }
570 if (_result != null) { 579 if (_result != null) {
571 jsonObject[RESULT] = _result; 580 jsonObject[RESULT] = _result;
572 } 581 }
573 return jsonObject; 582 return jsonObject;
574 } 583 }
575 } 584 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | pkg/analyzer/lib/src/util/absolute_path.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698