| 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 * Represents each volume, such as "drive", "download directory", each "USB | 8 * Represents each volume, such as "drive", "download directory", each "USB |
| 9 * flush storage", or "mounted zip archive" etc. | 9 * flush storage", or "mounted zip archive" etc. |
| 10 * | 10 * |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 if (status === util.VolumeError.PATH_UNMOUNTED) { | 479 if (status === util.VolumeError.PATH_UNMOUNTED) { |
| 480 console.warn('Volume already unmounted: ', mountPath); | 480 console.warn('Volume already unmounted: ', mountPath); |
| 481 status = 'success'; | 481 status = 'success'; |
| 482 } | 482 } |
| 483 var requestKey = this.makeRequestKey_('unmount', mountPath); | 483 var requestKey = this.makeRequestKey_('unmount', mountPath); |
| 484 var requested = requestKey in this.requests_; | 484 var requested = requestKey in this.requests_; |
| 485 var volumeInfo = this.volumeInfoList.find(mountPath); | 485 var volumeInfo = this.volumeInfoList.find(mountPath); |
| 486 if (event.status === 'success' && !requested && volumeInfo) { | 486 if (event.status === 'success' && !requested && volumeInfo) { |
| 487 console.warn('Mounted volume without a request: ', mountPath); | 487 console.warn('Mounted volume without a request: ', mountPath); |
| 488 var e = new Event('externally-unmounted'); | 488 var e = new Event('externally-unmounted'); |
| 489 // TODO(mtomasz): The mountPath field is deprecated. Remove it. |
| 489 e.mountPath = mountPath; | 490 e.mountPath = mountPath; |
| 490 e.volumeType = volumeInfo.volumeType; | 491 e.volumeInfo = volumeInfo; |
| 491 this.dispatchEvent(e); | 492 this.dispatchEvent(e); |
| 492 } | 493 } |
| 493 this.finishRequest_(requestKey, status); | 494 this.finishRequest_(requestKey, status); |
| 494 | 495 |
| 495 if (event.status === 'success') | 496 if (event.status === 'success') |
| 496 this.volumeInfoList.remove(mountPath); | 497 this.volumeInfoList.remove(mountPath); |
| 497 } | 498 } |
| 498 }; | 499 }; |
| 499 | 500 |
| 500 /** | 501 /** |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 callbacks[i].apply(self, args); | 707 callbacks[i].apply(self, args); |
| 707 } | 708 } |
| 708 }; | 709 }; |
| 709 if (status === 'success') { | 710 if (status === 'success') { |
| 710 callEach(request.successCallbacks, this, [opt_mountPath]); | 711 callEach(request.successCallbacks, this, [opt_mountPath]); |
| 711 } else { | 712 } else { |
| 712 volumeManagerUtil.validateError(status); | 713 volumeManagerUtil.validateError(status); |
| 713 callEach(request.errorCallbacks, this, [status]); | 714 callEach(request.errorCallbacks, this, [status]); |
| 714 } | 715 } |
| 715 }; | 716 }; |
| OLD | NEW |