Commit 19a9dc70 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Content metadata provider: comment fix

Comment only change. Use "metadata Worker" everywhere, fix grammatical
errors, createError_ is not just used by the Worker, add minor TODO.

Bug: 1114622
Change-Id: I009879b0763c7d33114acfcf1353b713e9924c84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377331
Commit-Queue: Naoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Auto-Submit: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801745}
parent c33a2619
......@@ -67,6 +67,7 @@ class ContentMetadataProvider extends MetadataProvider {
const promises = [];
for (let i = 0; i < requests.length; i++) {
// TODO(crbug.com/1114622): is the .bind actually needed here?
promises.push(new Promise(((request, fulfill) => {
this.getImpl_(
request.entry, request.names, fulfill);
......@@ -76,11 +77,11 @@ class ContentMetadataProvider extends MetadataProvider {
}
/**
* Fetches the metadata.
* Fetches the entry metadata.
* @param {!Entry} entry File entry.
* @param {!Array<string>} names Requested metadata type.
* @param {function(!MetadataItem)} callback Callback expects metadata value.
* This callback is called asynchronously.
* @param {!Array<string>} names Requested metadata types.
* @param {function(!MetadataItem)} callback MetadataItem callback. Note
* this callback is called asynchronously.
* @private
*/
getImpl_(entry, names, callback) {
......@@ -239,7 +240,7 @@ class ContentMetadataProvider extends MetadataProvider {
}
/**
* Handles the 'initialized' message from the metadata reader Worker.
* Handles the 'initialized' message from the metadata Worker.
* @param {RegExp} regexp Regexp of supported urls.
* @private
*/
......@@ -257,7 +258,7 @@ class ContentMetadataProvider extends MetadataProvider {
}
/**
* Handles the 'result' message from the worker.
* Handles the 'result' message from the metadata Worker.
* @param {string} url File url.
* @param {!MetadataItem} metadataItem The metadata item.
* @private
......@@ -271,7 +272,7 @@ class ContentMetadataProvider extends MetadataProvider {
}
/**
* Handles the 'log' message from the worker.
* Handles the 'log' message from the metadata Worker.
* @param {Array<*>} arglist Log arguments.
* @private
*/
......@@ -284,7 +285,7 @@ class ContentMetadataProvider extends MetadataProvider {
* Dispatches a message from MediaGalleries API to the appropriate on* method.
* @param {!Entry} entry File entry.
* @param {!Object} metadata The metadata from MediaGalleries API.
* @return {!Promise<!MetadataItem>} Promise that resolves with
* @return {!Promise<!MetadataItem>} Promise that resolves with the
* converted metadata item.
* @private
*/
......@@ -367,9 +368,9 @@ class ContentMetadataProvider extends MetadataProvider {
}
/**
* Handles the 'error' message from the worker.
* Returns an 'error' MetadataItem.
* @param {string} url File entry.
* @param {string} step Step failed.
* @param {string} step Step that failed.
* @param {string} errorDescription Error description.
* @return {!MetadataItem} Error metadata
* @private
......@@ -392,7 +393,7 @@ class ContentMetadataProvider extends MetadataProvider {
ContentMetadataProvider.Error = class extends Error {
/**
* @param {string} url File Entry.
* @param {string} step Step failed.
* @param {string} step Step that failed.
* @param {string} errorDescription Error description.
*/
constructor(url, step, errorDescription) {
......@@ -429,7 +430,7 @@ ContentMetadataProvider.PROPERTY_NAMES = [
];
/**
* Path of a worker script.
* The metadata Worker script URL.
* @public @const {string}
*/
ContentMetadataProvider.WORKER_SCRIPT =
......
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