| 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 /** | 5 /** |
| 6 * VolumeManager is responsible for tracking list of mounted volumes. | 6 * VolumeManager is responsible for tracking list of mounted volumes. |
| 7 * | 7 * |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {cr.EventTarget} | 9 * @extends {cr.EventTarget} |
| 10 */ | 10 */ |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 return; | 513 return; |
| 514 } | 514 } |
| 515 throw new Error('Invalid mount error: ', error); | 515 throw new Error('Invalid mount error: ', error); |
| 516 }; | 516 }; |
| 517 | 517 |
| 518 /** | 518 /** |
| 519 * @param {string} mountPath Mount path. | 519 * @param {string} mountPath Mount path. |
| 520 * @private | 520 * @private |
| 521 */ | 521 */ |
| 522 VolumeManager.prototype.validateMountPath_ = function(mountPath) { | 522 VolumeManager.prototype.validateMountPath_ = function(mountPath) { |
| 523 if (!/^\/(((archive|removable)\/[^\/]+)|drive|drive_offline|Downloads)$/. | 523 console.log(mountPath); |
| 524 test(mountPath)) | 524 if (!/^\/(drive|drive_offline|Downloads)$/.test(mountPath) && |
| 525 !/^\/((archive|removable|drive)\/[^\/]+)$/.test(mountPath)) |
| 525 throw new Error('Invalid mount path: ', mountPath); | 526 throw new Error('Invalid mount path: ', mountPath); |
| 526 }; | 527 }; |
| OLD | NEW |