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 url to an object containing properties. | 6 * MetadataCache is a map from url 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 527 |
528 /** | 528 /** |
529 * Ask the GData service to re-fetch the metadata. | 529 * Ask the GData service to re-fetch the metadata. |
530 * @param {string} fileURL File URL. | 530 * @param {string} fileURL File URL. |
531 */ | 531 */ |
532 MetadataCache.prototype.refreshFileMetadata = function(fileURL) { | 532 MetadataCache.prototype.refreshFileMetadata = function(fileURL) { |
533 if (!FileType.isOnGDrive(fileURL)) | 533 if (!FileType.isOnGDrive(fileURL)) |
534 return; | 534 return; |
535 // TODO(kaznacheev) This does not really work with GData search. | 535 // TODO(kaznacheev) This does not really work with GData search. |
536 var url = fileURL.substr(0, fileURL.lastIndexOf('/')); | 536 var url = fileURL.substr(0, fileURL.lastIndexOf('/')); |
537 metadataCache.refreshDirectory(url); | 537 this.refreshDirectory(url); |
538 }; | 538 }; |
539 | 539 |
540 /** | 540 /** |
541 * Resumes refreshes by resreshDirectory. | 541 * Resumes refreshes by resreshDirectory. |
542 * @param {string} url Directory URL. | 542 * @param {string} url Directory URL. |
543 */ | 543 */ |
544 MetadataCache.prototype.resumeRefresh = function(url) { | 544 MetadataCache.prototype.resumeRefresh = function(url) { |
545 delete this.directoriesWithStaleMetadata_[url]; | 545 delete this.directoriesWithStaleMetadata_[url]; |
546 }; | 546 }; |
547 | 547 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 | 999 |
1000 /** | 1000 /** |
1001 * Handles the 'log' message from the worker. | 1001 * Handles the 'log' message from the worker. |
1002 * @param {Array.<*>} arglist Log arguments. | 1002 * @param {Array.<*>} arglist Log arguments. |
1003 * @private | 1003 * @private |
1004 */ | 1004 */ |
1005 ContentProvider.prototype.onLog_ = function(arglist) { | 1005 ContentProvider.prototype.onLog_ = function(arglist) { |
1006 if (MetadataCache.log) // Avoid log spam by default. | 1006 if (MetadataCache.log) // Avoid log spam by default. |
1007 console.log.apply(console, ['metadata:'].concat(arglist)); | 1007 console.log.apply(console, ['metadata:'].concat(arglist)); |
1008 }; | 1008 }; |
OLD | NEW |