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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 new ExternalProvider(volumeManager), | 122 new ExternalProvider(volumeManager), |
123 new FilesystemProvider(), | 123 new FilesystemProvider(), |
124 new ContentProvider() | 124 new ContentProvider() |
125 ]); | 125 ]); |
126 }; | 126 }; |
127 | 127 |
128 /** | 128 /** |
129 * Clones metadata entry. Metadata entries may contain scalars, arrays, | 129 * Clones metadata entry. Metadata entries may contain scalars, arrays, |
130 * hash arrays and Date object. Other objects are not supported. | 130 * hash arrays and Date object. Other objects are not supported. |
131 * @param {Object} metadata Metadata object. | 131 * @param {Object} metadata Metadata object. |
132 * @return {!Object} Cloned entry. | 132 * @return {Object} Cloned entry. |
133 */ | 133 */ |
134 MetadataCache.cloneMetadata = function(metadata) { | 134 MetadataCache.cloneMetadata = function(metadata) { |
135 if (metadata instanceof Array) { | 135 if (metadata instanceof Array) { |
136 var result = []; | 136 var result = []; |
137 for (var index = 0; index < metadata.length; index++) { | 137 for (var index = 0; index < metadata.length; index++) { |
138 result[index] = MetadataCache.cloneMetadata(metadata[index]); | 138 result[index] = MetadataCache.cloneMetadata(metadata[index]); |
139 } | 139 } |
140 return result; | 140 return result; |
141 } else if (metadata instanceof Date) { | 141 } else if (metadata instanceof Date) { |
142 var result = new Date(); | 142 var result = new Date(); |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 | 1109 |
1110 /** | 1110 /** |
1111 * Handles the 'log' message from the worker. | 1111 * Handles the 'log' message from the worker. |
1112 * @param {Array.<*>} arglist Log arguments. | 1112 * @param {Array.<*>} arglist Log arguments. |
1113 * @private | 1113 * @private |
1114 */ | 1114 */ |
1115 ContentProvider.prototype.onLog_ = function(arglist) { | 1115 ContentProvider.prototype.onLog_ = function(arglist) { |
1116 if (MetadataCache.log) // Avoid log spam by default. | 1116 if (MetadataCache.log) // Avoid log spam by default. |
1117 console.log.apply(console, ['metadata:'].concat(arglist)); | 1117 console.log.apply(console, ['metadata:'].concat(arglist)); |
1118 }; | 1118 }; |
OLD | NEW |