Chromium Code Reviews| Index: chrome/browser/resources/file_manager/common/js/util.js |
| diff --git a/chrome/browser/resources/file_manager/common/js/util.js b/chrome/browser/resources/file_manager/common/js/util.js |
| index afc29fabf76880fe322c7b0836f3eddb53122fc5..0eab9227c3248359e970485b847d080cda04b145 100644 |
| --- a/chrome/browser/resources/file_manager/common/js/util.js |
| +++ b/chrome/browser/resources/file_manager/common/js/util.js |
| @@ -1150,9 +1150,12 @@ util.entriesToURLs = function(entries) { |
| * @param {Array.<string>} urls Input array of URLs. |
| * @param {function(Array.<Entry>)} callback Completion callback with array of |
| * Entries. |
|
yoshiki
2014/02/14 10:24:11
Please mention that the both errorCallback and cal
hirono
2014/02/14 10:42:37
Let me combine the callbacks!
|
| + * @param {function(Array.<Entry>)} opt_errorCallback Error callback with array |
| + * of URLs failed to be resolved. |
| */ |
| -util.URLsToEntries = function(urls, callback) { |
| +util.URLsToEntries = function(urls, callback, opt_errorCallback) { |
| var result = []; |
| + var failureUrl = []; |
| AsyncUtil.forEach( |
| urls, |
| function(forEachCallback, url) { |
| @@ -1162,11 +1165,14 @@ util.URLsToEntries = function(urls, callback) { |
| }, function() { |
| // Not an error. Possibly, the file is not accessible anymore. |
| console.warn('Failed to resolve the file with url: ' + url + '.'); |
| + failureUrl.push(url); |
| forEachCallback(); |
| }); |
| }, |
| function() { |
| callback(result); |
| + if (opt_errorCallback) |
| + opt_errorCallback(failureUrl); |
| }); |
| }; |