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

Unified Diff: ui/file_manager/file_manager/foreground/js/metadata/mpeg_parser.js

Issue 828983003: Add type annotations to metadata_dispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits. Created 5 years, 12 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 | « ui/file_manager/file_manager/foreground/js/metadata/metadata_parser.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/metadata/mpeg_parser.js
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/mpeg_parser.js b/ui/file_manager/file_manager/foreground/js/metadata/mpeg_parser.js
index 63cacedd72d6c82b23268c773331a15c3158cc91..55ace666d65589ff442264b435521383bd974790 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/mpeg_parser.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/mpeg_parser.js
@@ -5,6 +5,8 @@
/**
* @param {MetadataDispatcher} parent Parent object.
* @constructor
+ * @extends {MetadataParser}
+ * @struct
*/
function MpegParser(parent) {
MetadataParser.call(this, parent, 'mpeg', /\.(mp4|m4v|m4a|mpe?g4?)$/i);
@@ -140,11 +142,10 @@ MpegParser.createRootParser = function(metadata) {
};
/**
- *
* @param {File} file File.
* @param {Object} metadata Metadata.
* @param {function(Object)} callback Success callback.
- * @param {function} onError Error callback.
+ * @param {function((ProgressEvent|string))} onError Error callback.
*/
MpegParser.prototype.parse = function(file, metadata, callback, onError) {
var rootParser = MpegParser.createRootParser(metadata);
@@ -233,9 +234,9 @@ MpegParser.prototype.parseMpegAtomsInRange = function(
* @param {File} file File.
* @param {number} filePos Start position in the file.
* @param {number} size Atom size.
- * @param {string} name Atom name.
- * @param {function} onError Error callback.
- * @param {function} onSuccess Success callback.
+ * @param {string?} name Atom name.
+ * @param {function((ProgressEvent|string))} onError Error callback.
+ * @param {function()} onSuccess Success callback.
*/
MpegParser.prototype.requestRead = function(
rootParser, file, filePos, size, name, onError, onSuccess) {
@@ -244,8 +245,8 @@ MpegParser.prototype.requestRead = function(
reader.onerror = onError;
reader.onload = function(event) {
self.processTopLevelAtom(
- reader.result, rootParser, file, filePos, size, name,
- onError, onSuccess);
+ /** @type {ArrayBuffer} */ (reader.result), rootParser, file, filePos,
+ size, name, onError, onSuccess);
};
this.vlog('reading @' + filePos + ':' + size);
reader.readAsArrayBuffer(file.slice(filePos, filePos + size));
@@ -257,9 +258,9 @@ MpegParser.prototype.requestRead = function(
* @param {File} file File.
* @param {number} filePos Start position in the file.
* @param {number} size Atom size.
- * @param {string} name Atom name.
- * @param {function} onError Error callback.
- * @param {function} onSuccess Success callback.
+ * @param {string?} name Atom name.
+ * @param {function((ProgressEvent|string))} onError Error callback.
+ * @param {function()} onSuccess Success callback.
*/
MpegParser.prototype.processTopLevelAtom = function(
buf, rootParser, file, filePos, size, name, onError, onSuccess) {
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/metadata/metadata_parser.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698