Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: chrome/browser/resources/file_manager/js/directory_model.js

Issue 10828051: Cancel previous scan when replacing the directory contents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 * 380 *
381 * This should be used when changing directory or initiating a new search. 381 * This should be used when changing directory or initiating a new search.
382 * 382 *
383 * @private 383 * @private
384 * @param {DirectoryContentes} newDirContents New DirectoryContents instance to 384 * @param {DirectoryContentes} newDirContents New DirectoryContents instance to
385 * replace currentDirContents_. 385 * replace currentDirContents_.
386 * @param {Function} opt_callback Called on success. 386 * @param {Function} opt_callback Called on success.
387 */ 387 */
388 DirectoryModel.prototype.clearAndScan_ = function(newDirContents, 388 DirectoryModel.prototype.clearAndScan_ = function(newDirContents,
389 opt_callback) { 389 opt_callback) {
390 this.currentDirContents_.cancelScan();
390 this.currentDirContents_ = newDirContents; 391 this.currentDirContents_ = newDirContents;
391 this.clearRescanTimeout_(); 392 this.clearRescanTimeout_();
392 393
393 if (this.pendingScan_) 394 if (this.pendingScan_)
394 this.pendingScan_ = false; 395 this.pendingScan_ = false;
395 396
396 if (this.runningScan_) { 397 if (this.runningScan_) {
397 this.runningScan_.cancelScan(); 398 this.runningScan_.cancelScan();
398 this.runningScan_ = null; 399 this.runningScan_ = null;
399 } 400 }
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 }.bind(this)); 1324 }.bind(this));
1324 } 1325 }
1325 }; 1326 };
1326 1327
1327 /** 1328 /**
1328 * @return {DirectoryEntry} Current watched directory entry. 1329 * @return {DirectoryEntry} Current watched directory entry.
1329 */ 1330 */
1330 FileWatcher.prototype.getWatchedDirectoryEntry = function() { 1331 FileWatcher.prototype.getWatchedDirectoryEntry = function() {
1331 return this.watchedDirectoryEntry_; 1332 return this.watchedDirectoryEntry_;
1332 }; 1333 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698