Index: ui/file_manager/file_manager/foreground/js/metadata/byte_reader.js |
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/byte_reader.js b/ui/file_manager/file_manager/foreground/js/metadata/byte_reader.js |
index 09cf306b53c6fae1a9fd51766d90afd9429c1437..30f2d011f1ea7338473f79545d48a9f7aa787f9f 100644 |
--- a/ui/file_manager/file_manager/foreground/js/metadata/byte_reader.js |
+++ b/ui/file_manager/file_manager/foreground/js/metadata/byte_reader.js |
@@ -6,9 +6,9 @@ |
/** |
* @constructor |
- * @param {ArrayBuffer} arrayBuffer // TODO(JSDOC). |
- * @param {number=} opt_offset // TODO(JSDOC). |
- * @param {number=} opt_length // TODO(JSDOC). |
+ * @param {ArrayBuffer} arrayBuffer An array of buffers to be read from. |
+ * @param {number=} opt_offset Offset to read bytes at. |
+ * @param {number=} opt_length Number of bytes to read. |
*/ |
function ByteReader(arrayBuffer, opt_offset, opt_length) { |
opt_offset = opt_offset || 0; |
@@ -58,9 +58,9 @@ ByteReader.SEEK_END = 2; |
* |
* Static utility function. |
* |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number} end // TODO(JSDOC). |
+ * @param {number} pos Position in the file. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number} end Maximum position to read from. |
*/ |
ByteReader.validateRead = function(pos, size, end) { |
if (pos < 0 || pos >= end) |
@@ -76,11 +76,11 @@ ByteReader.validateRead = function(pos, size, end) { |
* This is a static utility function. There is a member function with the |
* same name which side-effects the current read position. |
* |
- * @param {DataView} dataView // TODO(JSDOC). |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {DataView} dataView Data view instance. |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Read string. |
*/ |
ByteReader.readString = function(dataView, pos, size, opt_end) { |
ByteReader.validateRead(pos, size, opt_end || dataView.byteLength); |
@@ -99,11 +99,11 @@ ByteReader.readString = function(dataView, pos, size, opt_end) { |
* This is a static utility function. There is a member function with the |
* same name which side-effects the current read position. |
* |
- * @param {DataView} dataView // TODO(JSDOC). |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {DataView} dataView Data view instance. |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Read string. |
*/ |
ByteReader.readNullTerminatedString = function(dataView, pos, size, opt_end) { |
ByteReader.validateRead(pos, size, opt_end || dataView.byteLength); |
@@ -125,12 +125,12 @@ ByteReader.readNullTerminatedString = function(dataView, pos, size, opt_end) { |
* This is a static utility function. There is a member function with the |
* same name which side-effects the current read position. |
* |
- * @param {DataView} dataView // TODO(JSDOC). |
- * @param {number} pos // TODO(JSDOC). |
- * @param {boolean} bom // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {DataView} dataView Data view instance. |
+ * @param {boolean} bom True if BOM should be parsed. |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Read string. |
*/ |
ByteReader.readNullTerminatedStringUTF16 = function( |
dataView, pos, bom, size, opt_end) { |
@@ -171,11 +171,11 @@ ByteReader.base64Alphabet_ = |
* This is a static utility function. There is a member function with the |
* same name which side-effects the current read position. |
* |
- * @param {DataView} dataView // TODO(JSDOC). |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {DataView} dataView Data view instance. |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Base 64 encoded value. |
*/ |
ByteReader.readBase64 = function(dataView, pos, size, opt_end) { |
ByteReader.validateRead(pos, size, opt_end || dataView.byteLength); |
@@ -221,11 +221,11 @@ ByteReader.readBase64 = function(dataView, pos, size, opt_end) { |
* This is a static utility function. There is a member function with the |
* same name which side-effects the current read position. |
* |
- * @param {DataView} dataView // TODO(JSDOC). |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {DataView} dataView Data view instance. |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Image as a data url. |
*/ |
ByteReader.readImage = function(dataView, pos, size, opt_end) { |
opt_end = opt_end || dataView.byteLength; |
@@ -252,8 +252,8 @@ ByteReader.readImage = function(dataView, pos, size, opt_end) { |
/** |
* Return true if the requested number of bytes can be read from the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @return {boolean} // TODO(JSDOC). |
+ * @param {number} size Number of bytes to read. |
+ * @return {boolean} True if allowed, false otherwise. |
*/ |
ByteReader.prototype.canRead = function(size) { |
return this.pos_ + size <= this.view_.byteLength; |
@@ -261,7 +261,7 @@ ByteReader.prototype.canRead = function(size) { |
/** |
* Return true if the current position is past the end of the buffer. |
- * @return {boolean} // TODO(JSDOC). |
+ * @return {boolean} True if EOF, otherwise false. |
*/ |
ByteReader.prototype.eof = function() { |
return this.pos_ >= this.view_.byteLength; |
@@ -269,7 +269,7 @@ ByteReader.prototype.eof = function() { |
/** |
* Return true if the current position is before the beginning of the buffer. |
- * @return {boolean} // TODO(JSDOC). |
+ * @return {boolean} True if BOF, otherwise false. |
*/ |
ByteReader.prototype.bof = function() { |
return this.pos_ < 0; |
@@ -277,7 +277,7 @@ ByteReader.prototype.bof = function() { |
/** |
* Return true if the current position is outside the buffer. |
- * @return {boolean} // TODO(JSDOC). |
+ * @return {boolean} True if outside, false if inside. |
*/ |
ByteReader.prototype.beof = function() { |
return this.pos_ >= this.view_.byteLength || this.pos_ < 0; |
@@ -285,7 +285,7 @@ ByteReader.prototype.beof = function() { |
/** |
* Set the expected byte ordering for future reads. |
- * @param {number} order // TODO(JSDOC). |
+ * @param {number} order Byte order. Either LITTLE_ENDIAN or BIG_ENDIAN. |
*/ |
ByteReader.prototype.setByteOrder = function(order) { |
this.littleEndian_ = order == ByteReader.LITTLE_ENDIAN; |
@@ -298,8 +298,8 @@ ByteReader.prototype.setByteOrder = function(order) { |
* You may optionally pass opt_end to override what is considered to be the |
* end of the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
*/ |
ByteReader.prototype.validateRead = function(size, opt_end) { |
if (typeof opt_end == 'undefined') |
@@ -309,10 +309,10 @@ ByteReader.prototype.validateRead = function(size, opt_end) { |
}; |
/** |
- * @param {number} width // TODO(JSDOC). |
- * @param {boolean=} opt_signed // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {number} width Number of bytes to read. |
+ * @param {boolean=} opt_signed True if signed, false otherwise. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Scalar value. |
*/ |
ByteReader.prototype.readScalar = function(width, opt_signed, opt_end) { |
var method = opt_signed ? 'getInt' : 'getUint'; |
@@ -351,9 +351,9 @@ ByteReader.prototype.readScalar = function(width, opt_signed, opt_end) { |
* Adjusts the current position on success. Throws an exception if the |
* read would go past the end of the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} String value. |
*/ |
ByteReader.prototype.readString = function(size, opt_end) { |
var rv = ByteReader.readString(this.view_, this.pos_, size, opt_end); |
@@ -368,9 +368,9 @@ ByteReader.prototype.readString = function(size, opt_end) { |
* Adjusts the current position on success. Throws an exception if the |
* read would go past the end of the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Null-terminated string value. |
*/ |
ByteReader.prototype.readNullTerminatedString = function(size, opt_end) { |
var rv = ByteReader.readNullTerminatedString(this.view_, |
@@ -395,10 +395,11 @@ ByteReader.prototype.readNullTerminatedString = function(size, opt_end) { |
* Adjusts the current position on success. Throws an exception if the |
* read would go past the end of the buffer. |
* |
- * @param {boolean} bom // TODO(JSDOC). |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {boolean} bom True if BOM should be parsed. |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Read string. |
*/ |
ByteReader.prototype.readNullTerminatedStringUTF16 = |
function(bom, size, opt_end) { |
@@ -428,10 +429,10 @@ ByteReader.prototype.readNullTerminatedStringUTF16 = |
* Adjusts the current position on success. Throws an exception if the |
* read would go past the end of the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @param {function(new:Array.<*>)=} opt_arrayConstructor // TODO(JSDOC). |
- * @return {Array.<*>} // TODO(JSDOC). |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @param {function(new:Array.<*>)=} opt_arrayConstructor Array constructor. |
+ * @return {Array.<*>} Array of bytes. |
*/ |
ByteReader.prototype.readSlice = function(size, opt_end, |
opt_arrayConstructor) { |
@@ -452,9 +453,9 @@ ByteReader.prototype.readSlice = function(size, opt_end, |
* Adjusts the current position on success. Throws an exception if the |
* read would go past the end of the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Base 64 encoded value. |
*/ |
ByteReader.prototype.readBase64 = function(size, opt_end) { |
var rv = ByteReader.readBase64(this.view_, this.pos_, size, opt_end); |
@@ -468,9 +469,10 @@ ByteReader.prototype.readBase64 = function(size, opt_end) { |
* Adjusts the current position on success. Throws an exception if the |
* read would go past the end of the buffer. |
* |
- * @param {number} size // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
- * @return {string} // TODO(JSDOC). |
+ * @param {number} pos Position in bytes to read from. |
+ * @param {number} size Number of bytes to read. |
+ * @param {number=} opt_end Maximum position to read from. |
+ * @return {string} Image as a data url. |
*/ |
ByteReader.prototype.readImage = function(size, opt_end) { |
var rv = ByteReader.readImage(this.view_, this.pos_, size, opt_end); |
@@ -481,9 +483,9 @@ ByteReader.prototype.readImage = function(size, opt_end) { |
/** |
* Seek to a give position relative to opt_seekStart. |
* |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number=} opt_seekStart // TODO(JSDOC). |
- * @param {number=} opt_end // TODO(JSDOC). |
+ * @param {number} pos Position in bytes to seek to. |
+ * @param {number=} opt_seekStart Relative position in bytes. |
+ * @param {number=} opt_end Maximum position to seek to. |
*/ |
ByteReader.prototype.seek = function(pos, opt_seekStart, opt_end) { |
opt_end = opt_end || this.view_.byteLength; |
@@ -509,8 +511,8 @@ ByteReader.prototype.seek = function(pos, opt_seekStart, opt_end) { |
* |
* Recover the current position with a call to seekPop. |
* |
- * @param {number} pos // TODO(JSDOC). |
- * @param {number=} opt_seekStart // TODO(JSDOC). |
+ * @param {number} pos Position in bytes to seek to. |
+ * @param {number=} opt_seekStart Relative position in bytes. |
*/ |
ByteReader.prototype.pushSeek = function(pos, opt_seekStart) { |
var oldPos = this.pos_; |
@@ -528,7 +530,7 @@ ByteReader.prototype.popSeek = function() { |
/** |
* Return the current read position. |
- * @return {number} // TODO(JSDOC). |
+ * @return {number} Current position in bytes. |
*/ |
ByteReader.prototype.tell = function() { |
return this.pos_; |