Commit 5af805a9 authored by Andrei-Laurențiu Olteanu's avatar Andrei-Laurențiu Olteanu Committed by Commit Bot

[Telemetry SWX] Change annotations for dpsl

Add not null annotation to all types.

Change indentation to accommodate change.

Bug: b:162051831
Change-Id: I6c4ddc44733b46e5d09526eb073a41d3acab28b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2350422Reviewed-by: default avatarOleh Lamzin <lamzin@google.com>
Reviewed-by: default avatarMahmoud Gawad <mgawad@google.com>
Commit-Queue: Laurențiu Olteanu <lolteanu@google.com>
Cr-Commit-Position: refs/heads/master@{#813163}
parent fbc653a8
...@@ -15,7 +15,7 @@ const dpsl_internal = {}; ...@@ -15,7 +15,7 @@ const dpsl_internal = {};
/** /**
* Enum for message types. * Enum for message types.
* @enum { string } * @enum { !string }
*/ */
dpsl_internal.Message = { dpsl_internal.Message = {
DIAGNOSTICS_AVAILABLE_ROUTINES: 'DiagnosticsService.GetAvailableRoutines', DIAGNOSTICS_AVAILABLE_ROUTINES: 'DiagnosticsService.GetAvailableRoutines',
......
...@@ -211,7 +211,7 @@ class DiagnosticsProxy { ...@@ -211,7 +211,7 @@ class DiagnosticsProxy {
/** /**
* Requests available routines. * Requests available routines.
* @return { !Promise<dpsl_internal.DiagnosticsGetAvailableRoutinesResponse> } * @return {!Promise<!dpsl_internal.DiagnosticsGetAvailableRoutinesResponse>}
*/ */
async handleGetAvailableRoutines() { async handleGetAvailableRoutines() {
const availableRoutines = const availableRoutines =
...@@ -305,11 +305,11 @@ class DiagnosticsProxy { ...@@ -305,11 +305,11 @@ class DiagnosticsProxy {
/** /**
* Runs a command on a routine. * Runs a command on a routine.
* @param { !Object } message * @param { !Object } message
* @return { !Promise<dpsl_internal.DiagnosticsGetRoutineUpdateResponse> } * @return { !Promise<!dpsl_internal.DiagnosticsGetRoutineUpdateResponse> }
*/ */
async handleGetRoutineUpdate(message) { async handleGetRoutineUpdate(message) {
const request = const request =
/** @type {dpsl_internal.DiagnosticsGetRoutineUpdateRequest} */ ( /** @type {!dpsl_internal.DiagnosticsGetRoutineUpdateRequest} */ (
message); message);
let routine, command; let routine, command;
...@@ -347,7 +347,7 @@ class DiagnosticsProxy { ...@@ -347,7 +347,7 @@ class DiagnosticsProxy {
try { try {
const response = await handler(message); const response = await handler(message);
return this.convertRunRoutineResponse(response.response); return this.convertRunRoutineResponse(response.response);
} catch (/** @type !Error */ error) { } catch (/** @type {!Error} */ error) {
return error; return error;
} }
}; };
...@@ -841,7 +841,7 @@ class TelemetryProxy { ...@@ -841,7 +841,7 @@ class TelemetryProxy {
/** /**
* Requests telemetry info. * Requests telemetry info.
* @param { Object } message * @param { !Object } message
* @return { !Promise<!dpsl_internal.ProbeTelemetryInfoResponse> } * @return { !Promise<!dpsl_internal.ProbeTelemetryInfoResponse> }
*/ */
async handleProbeTelemetryInfo(message) { async handleProbeTelemetryInfo(message) {
......
...@@ -45,9 +45,9 @@ chromeos.test_support = {}; ...@@ -45,9 +45,9 @@ chromeos.test_support = {};
*/ */
async getAvailableRoutines() { async getAvailableRoutines() {
const response = const response =
/** @type {dpsl_internal.DiagnosticsGetAvailableRoutinesResponse} */ ( /** @type {!dpsl_internal.DiagnosticsGetAvailableRoutinesResponse} */
await messagePipe.sendMessage( (await messagePipe.sendMessage(
dpsl_internal.Message.DIAGNOSTICS_AVAILABLE_ROUTINES)); dpsl_internal.Message.DIAGNOSTICS_AVAILABLE_ROUTINES));
return response; return response;
} }
...@@ -61,7 +61,7 @@ chromeos.test_support = {}; ...@@ -61,7 +61,7 @@ chromeos.test_support = {};
*/ */
async sendCommandToRoutine(routineId, command, includeOutput) { async sendCommandToRoutine(routineId, command, includeOutput) {
const message = const message =
/** @type {dpsl_internal.DiagnosticsGetRoutineUpdateRequest} */ ({ /** @type {!dpsl_internal.DiagnosticsGetRoutineUpdateRequest} */ ({
routineId: routineId, routineId: routineId,
command: command, command: command,
includeOutput: includeOutput, includeOutput: includeOutput,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment