| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Scanner of the entries. | 8 * Scanner of the entries. |
| 9 * @constructor | 9 * @constructor |
| 10 */ | 10 */ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 * Extends ContentScanner. | 51 * Extends ContentScanner. |
| 52 */ | 52 */ |
| 53 DirectoryContentScanner.prototype.__proto__ = ContentScanner.prototype; | 53 DirectoryContentScanner.prototype.__proto__ = ContentScanner.prototype; |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Starts to read the entries in the directory. | 56 * Starts to read the entries in the directory. |
| 57 * @override | 57 * @override |
| 58 */ | 58 */ |
| 59 DirectoryContentScanner.prototype.scan = function( | 59 DirectoryContentScanner.prototype.scan = function( |
| 60 entriesCallback, successCallback, errorCallback) { | 60 entriesCallback, successCallback, errorCallback) { |
| 61 if (!this.entry_ || | 61 if (!this.entry_ || util.isFakeEntry(this.entry_)) { |
| 62 (util.isFakeEntry(this.entry_) && | |
| 63 this.entry_.rootType === RootType.DRIVE)) { | |
| 64 // If entry is not specified or a fake, we cannot read it. | 62 // If entry is not specified or a fake, we cannot read it. |
| 65 errorCallback(util.createDOMError( | 63 errorCallback(util.createDOMError( |
| 66 util.FileError.INVALID_MODIFICATION_ERR)); | 64 util.FileError.INVALID_MODIFICATION_ERR)); |
| 67 return; | 65 return; |
| 68 } | 66 } |
| 69 | 67 |
| 70 metrics.startInterval('DirectoryScan'); | 68 metrics.startInterval('DirectoryScan'); |
| 71 var reader = this.entry_.createReader(); | 69 var reader = this.entry_.createReader(); |
| 72 var readEntries = function() { | 70 var readEntries = function() { |
| 73 reader.readEntries( | 71 reader.readEntries( |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 DirectoryContents.createForDriveMetadataSearch = function( | 738 DirectoryContents.createForDriveMetadataSearch = function( |
| 741 context, fakeDirectoryEntry, searchType) { | 739 context, fakeDirectoryEntry, searchType) { |
| 742 return new DirectoryContents( | 740 return new DirectoryContents( |
| 743 context, | 741 context, |
| 744 true, // Search | 742 true, // Search |
| 745 fakeDirectoryEntry, | 743 fakeDirectoryEntry, |
| 746 function() { | 744 function() { |
| 747 return new DriveMetadataSearchContentScanner(searchType); | 745 return new DriveMetadataSearchContentScanner(searchType); |
| 748 }); | 746 }); |
| 749 }; | 747 }; |
| OLD | NEW |