| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * MetadataCache is a map from Entry to an object containing properties. | 6 * MetadataCache is a map from Entry to an object containing properties. |
| 7 * Properties are divided by types, and all properties of one type are accessed | 7 * Properties are divided by types, and all properties of one type are accessed |
| 8 * at once. | 8 * at once. |
| 9 * Some of the properties: | 9 * Some of the properties: |
| 10 * { | 10 * { |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 function(propertiesList) { | 862 function(propertiesList) { |
| 863 console.assert(propertiesList.length === callbacks.length); | 863 console.assert(propertiesList.length === callbacks.length); |
| 864 for (var i = 0; i < callbacks.length; i++) { | 864 for (var i = 0; i < callbacks.length; i++) { |
| 865 callbacks[i](self.convert_(propertiesList[i], entries[i])); | 865 callbacks[i](self.convert_(propertiesList[i], entries[i])); |
| 866 } | 866 } |
| 867 }); | 867 }); |
| 868 }; | 868 }; |
| 869 | 869 |
| 870 /** | 870 /** |
| 871 * Converts API metadata to internal format. | 871 * Converts API metadata to internal format. |
| 872 * @param {Object} data Metadata from API call. | 872 * @param {!EntryProperties} data Metadata from API call. |
| 873 * @param {Entry} entry File entry. | 873 * @param {!Entry} entry File entry. |
| 874 * @return {Object} Metadata in internal format. | 874 * @return {!Object} Metadata in internal format. |
| 875 * @private | 875 * @private |
| 876 */ | 876 */ |
| 877 ExternalProvider.prototype.convert_ = function(data, entry) { | 877 ExternalProvider.prototype.convert_ = function(data, entry) { |
| 878 var result = {}; | 878 var result = {}; |
| 879 result.external = { | 879 result.external = { |
| 880 present: data.isPresent, | 880 present: data.isPresent, |
| 881 pinned: data.isPinned, | 881 pinned: data.isPinned, |
| 882 hosted: data.isHosted, | 882 hosted: data.isHosted, |
| 883 dirty: data.isDirty, | 883 dirty: data.isDirty, |
| 884 imageWidth: data.imageWidth, | 884 imageWidth: data.imageWidth, |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 | 1123 |
| 1124 /** | 1124 /** |
| 1125 * Handles the 'log' message from the worker. | 1125 * Handles the 'log' message from the worker. |
| 1126 * @param {Array.<*>} arglist Log arguments. | 1126 * @param {Array.<*>} arglist Log arguments. |
| 1127 * @private | 1127 * @private |
| 1128 */ | 1128 */ |
| 1129 ContentProvider.prototype.onLog_ = function(arglist) { | 1129 ContentProvider.prototype.onLog_ = function(arglist) { |
| 1130 if (MetadataCache.log) // Avoid log spam by default. | 1130 if (MetadataCache.log) // Avoid log spam by default. |
| 1131 console.log.apply(console, ['metadata:'].concat(arglist)); | 1131 console.log.apply(console, ['metadata:'].concat(arglist)); |
| 1132 }; | 1132 }; |
| OLD | NEW |