OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "webkit/browser/fileapi/external_mount_points.h" | 5 #include "storage/browser/fileapi/external_mount_points.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "webkit/browser/fileapi/file_system_url.h" | 11 #include "storage/browser/fileapi/file_system_url.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Normalizes file path so it has normalized separators and ends with exactly | 15 // Normalizes file path so it has normalized separators and ends with exactly |
16 // one separator. Paths have to be normalized this way for use in | 16 // one separator. Paths have to be normalized this way for use in |
17 // GetVirtualPath method. Separators cannot be completely stripped, or | 17 // GetVirtualPath method. Separators cannot be completely stripped, or |
18 // GetVirtualPath could not working in some edge cases. | 18 // GetVirtualPath could not working in some edge cases. |
19 // For example, /a/b/c(1)/d would be erroneously resolved as c/d if the | 19 // For example, /a/b/c(1)/d would be erroneously resolved as c/d if the |
20 // following mount points were registered: "/a/b/c", "/a/b/c(1)". (Note: | 20 // following mount points were registered: "/a/b/c", "/a/b/c(1)". (Note: |
21 // "/a/b/c" < "/a/b/c(1)" < "/a/b/c/"). | 21 // "/a/b/c" < "/a/b/c(1)" < "/a/b/c/"). |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 path.IsParent(potential_child->first)) { | 348 path.IsParent(potential_child->first)) { |
349 return false; | 349 return false; |
350 } | 350 } |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 return true; | 354 return true; |
355 } | 355 } |
356 | 356 |
357 } // namespace storage | 357 } // namespace storage |
OLD | NEW |