Merge "Add some comments for a consistent javascript style." am: 8fba7c3392 am: 2442ff73a0 am: 6b49b1f919
Original change: https://android-review.googlesource.com/c/platform/development/+/1754474 Change-Id: Ifb8593de603bd751ebbd3a0de35d9fa0f1aff613
This commit is contained in:
@@ -17,7 +17,7 @@ export class EchartsData {
|
|||||||
* @return {String} A list of [key, value].
|
* @return {String} A list of [key, value].
|
||||||
*/
|
*/
|
||||||
listData() {
|
listData() {
|
||||||
let table = ''
|
let /** String */ table = ''
|
||||||
for (let [key, value] of this.statisticData) {
|
for (let [key, value] of this.statisticData) {
|
||||||
table += key + ' : ' + value.toString() + ' Blocks' + '\n'
|
table += key + ' : ' + value.toString() + ' Blocks' + '\n'
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ export class EchartsData {
|
|||||||
* @return {Object} an ECharts option object.
|
* @return {Object} an ECharts option object.
|
||||||
*/
|
*/
|
||||||
getEchartsOption() {
|
getEchartsOption() {
|
||||||
let option = new Object()
|
let /** Object */ option = new Object()
|
||||||
option.title = {
|
option.title = {
|
||||||
text: this.title,
|
text: this.title,
|
||||||
left: "center"
|
left: "center"
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
import * as zip from '@zip.js/zip.js/dist/zip-full.min.js'
|
import * as zip from '@zip.js/zip.js/dist/zip-full.min.js'
|
||||||
import { chromeos_update_engine as update_metadata_pb } from './update_metadata_pb.js'
|
import { chromeos_update_engine as update_metadata_pb } from './update_metadata_pb.js'
|
||||||
|
|
||||||
const _MAGIC = 'CrAU'
|
const /** Number */ _MAGIC = 'CrAU'
|
||||||
const _VERSION_SIZE = 8
|
const /** Number */ _VERSION_SIZE = 8
|
||||||
const _MANIFEST_LEN_SIZE = 8
|
const /** Number */ _MANIFEST_LEN_SIZE = 8
|
||||||
const _METADATA_SIGNATURE_LEN_SIZE = 4
|
const /** Number */ _METADATA_SIGNATURE_LEN_SIZE = 4
|
||||||
const _BRILLO_MAJOR_PAYLOAD_VERSION = 2
|
const /** Number */ _BRILLO_MAJOR_PAYLOAD_VERSION = 2
|
||||||
|
|
||||||
export class Payload {
|
export class Payload {
|
||||||
/**
|
/**
|
||||||
@@ -27,7 +27,7 @@ export class Payload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async unzipPayload() {
|
async unzipPayload() {
|
||||||
let entries = await this.packedFile.getEntries()
|
let /** Array<Entry> */ entries = await this.packedFile.getEntries()
|
||||||
this.payload = null
|
this.payload = null
|
||||||
for (let entry of entries) {
|
for (let entry of entries) {
|
||||||
if (entry.filename == 'payload.bin') {
|
if (entry.filename == 'payload.bin') {
|
||||||
@@ -48,7 +48,7 @@ export class Payload {
|
|||||||
* @return {Int} an integer.
|
* @return {Int} an integer.
|
||||||
*/
|
*/
|
||||||
readInt(size) {
|
readInt(size) {
|
||||||
let view = new DataView(
|
let /** DataView */ view = new DataView(
|
||||||
this.buffer.slice(this.cursor, this.cursor + size))
|
this.buffer.slice(this.cursor, this.cursor + size))
|
||||||
this.cursor += size
|
this.cursor += size
|
||||||
switch (size) {
|
switch (size) {
|
||||||
@@ -64,7 +64,7 @@ export class Payload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readHeader() {
|
readHeader() {
|
||||||
let decoder = new TextDecoder()
|
let /** TextDecoder */ decoder = new TextDecoder()
|
||||||
try {
|
try {
|
||||||
this.magic = decoder.decode(
|
this.magic = decoder.decode(
|
||||||
this.buffer.slice(this.cursor, _MAGIC.length))
|
this.buffer.slice(this.cursor, _MAGIC.length))
|
||||||
@@ -89,7 +89,7 @@ export class Payload {
|
|||||||
* aosp/system/update_engine/update_metadata.proto
|
* aosp/system/update_engine/update_metadata.proto
|
||||||
*/
|
*/
|
||||||
readManifest() {
|
readManifest() {
|
||||||
let manifest_raw = new Uint8Array(this.buffer.slice(
|
let /** Array<Uint8> */ manifest_raw = new Uint8Array(this.buffer.slice(
|
||||||
this.cursor, this.cursor + this.manifest_len
|
this.cursor, this.cursor + this.manifest_len
|
||||||
))
|
))
|
||||||
this.cursor += this.manifest_len
|
this.cursor += this.manifest_len
|
||||||
@@ -98,7 +98,7 @@ export class Payload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readSignature() {
|
readSignature() {
|
||||||
let signature_raw = new Uint8Array(this.buffer.slice(
|
let /** Array<Uint8>*/ signature_raw = new Uint8Array(this.buffer.slice(
|
||||||
this.cursor, this.cursor + this.metadata_signature_len
|
this.cursor, this.cursor + this.metadata_signature_len
|
||||||
))
|
))
|
||||||
this.cursor += this.metadata_signature_len
|
this.cursor += this.metadata_signature_len
|
||||||
@@ -122,7 +122,7 @@ export class OpType {
|
|||||||
* update_metadata.proto and must be decoded before any usage.
|
* update_metadata.proto and must be decoded before any usage.
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() {
|
||||||
let types = update_metadata_pb.InstallOperation.Type
|
let /** Array<{String: Number}>*/ types = update_metadata_pb.InstallOperation.Type
|
||||||
this.mapType = new Map()
|
this.mapType = new Map()
|
||||||
for (let key in types) {
|
for (let key in types) {
|
||||||
this.mapType.set(types[key], key)
|
this.mapType.set(types[key], key)
|
||||||
|
|||||||
Reference in New Issue
Block a user