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 // If directory files changes too often, don't rescan directory more than once | 5 // If directory files changes too often, don't rescan directory more than once |
6 // per specified interval | 6 // per specified interval |
7 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; | 7 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; |
8 // Used for operations that require almost instant rescan. | 8 // Used for operations that require almost instant rescan. |
9 var SHORT_RESCAN_INTERVAL = 100; | 9 var SHORT_RESCAN_INTERVAL = 100; |
10 | 10 |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 } | 972 } |
973 | 973 |
974 function onGData(entry) { | 974 function onGData(entry) { |
975 console.log('GData found:', entry); | 975 console.log('GData found:', entry); |
976 self.unmountedGDataEntry_ = null; | 976 self.unmountedGDataEntry_ = null; |
977 groups.gdata = [entry]; | 977 groups.gdata = [entry]; |
978 done(); | 978 done(); |
979 } | 979 } |
980 | 980 |
981 function onGDataError(error) { | 981 function onGDataError(error) { |
982 console.log('GData error: ', error); | 982 console.log('GData error: ' + error); |
983 self.unmountedGDataEntry_ = { | 983 self.unmountedGDataEntry_ = { |
984 unmounted: true, // Clients use this field to distinguish a fake root. | 984 unmounted: true, // Clients use this field to distinguish a fake root. |
985 toURL: function() { return '' }, | 985 toURL: function() { return '' }, |
986 fullPath: '/' + DirectoryModel.GDATA_DIRECTORY | 986 fullPath: '/' + DirectoryModel.GDATA_DIRECTORY |
987 }; | 987 }; |
988 groups.gdata = [self.unmountedGDataEntry_]; | 988 groups.gdata = [self.unmountedGDataEntry_]; |
989 done(); | 989 done(); |
990 } | 990 } |
991 | 991 |
992 var root = this.root_; | 992 var root = this.root_; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 /** | 1262 /** |
1263 * @private | 1263 * @private |
1264 */ | 1264 */ |
1265 DirectoryModel.Scanner.prototype.recordMetrics_ = function() { | 1265 DirectoryModel.Scanner.prototype.recordMetrics_ = function() { |
1266 metrics.recordInterval('DirectoryScan'); | 1266 metrics.recordInterval('DirectoryScan'); |
1267 if (this.dir_.fullPath == | 1267 if (this.dir_.fullPath == |
1268 '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { | 1268 '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { |
1269 metrics.recordMediumCount('DownloadsCount', this.list_.length); | 1269 metrics.recordMediumCount('DownloadsCount', this.list_.length); |
1270 } | 1270 } |
1271 }; | 1271 }; |
OLD | NEW |