Chromium Code Reviews| 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): mountPath and mountType are obsolete and will be | |
| 490 // removed soon. Use volumeInfo instead. | |
| 489 e.mountPath = mountPath; | 491 e.mountPath = mountPath; |
| 490 e.volumeType = volumeInfo.volumeType; | 492 e.volumeType = volumeInfo.volumeType; |
|
hirono
2013/12/10 03:36:53
Please remove this property. We can get volumeType
mtomasz
2013/12/10 05:07:01
Done.
| |
| 493 e.volumeInfo = volumeInfo; | |
| 491 this.dispatchEvent(e); | 494 this.dispatchEvent(e); |
| 492 } | 495 } |
| 493 this.finishRequest_(requestKey, status); | 496 this.finishRequest_(requestKey, status); |
| 494 | 497 |
| 495 if (event.status === 'success') | 498 if (event.status === 'success') |
| 496 this.volumeInfoList.remove(mountPath); | 499 this.volumeInfoList.remove(mountPath); |
| 497 } | 500 } |
| 498 }; | 501 }; |
| 499 | 502 |
| 500 /** | 503 /** |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 callbacks[i].apply(self, args); | 709 callbacks[i].apply(self, args); |
| 707 } | 710 } |
| 708 }; | 711 }; |
| 709 if (status === 'success') { | 712 if (status === 'success') { |
| 710 callEach(request.successCallbacks, this, [opt_mountPath]); | 713 callEach(request.successCallbacks, this, [opt_mountPath]); |
| 711 } else { | 714 } else { |
| 712 volumeManagerUtil.validateError(status); | 715 volumeManagerUtil.validateError(status); |
| 713 callEach(request.errorCallbacks, this, [status]); | 716 callEach(request.errorCallbacks, this, [status]); |
| 714 } | 717 } |
| 715 }; | 718 }; |
| OLD | NEW |