| 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 "webkit/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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 return path; | 24 return path; |
| 25 | 25 |
| 26 base::FilePath::StringType path_str = path.StripTrailingSeparators().value(); | 26 base::FilePath::StringType path_str = path.StripTrailingSeparators().value(); |
| 27 if (!base::FilePath::IsSeparator(path_str[path_str.length() - 1])) | 27 if (!base::FilePath::IsSeparator(path_str[path_str.length() - 1])) |
| 28 path_str.append(FILE_PATH_LITERAL("/")); | 28 path_str.append(FILE_PATH_LITERAL("/")); |
| 29 | 29 |
| 30 return base::FilePath(path_str).NormalizePathSeparators(); | 30 return base::FilePath(path_str).NormalizePathSeparators(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool IsOverlappingMountPathForbidden(fileapi::FileSystemType type) { | 33 bool IsOverlappingMountPathForbidden(fileapi::FileSystemType type) { |
| 34 return type != fileapi::kFileSystemTypeNativeMedia; | 34 return type != fileapi::kFileSystemTypeNativeMedia && |
| 35 type != fileapi::kFileSystemTypeDeviceMedia; |
| 35 } | 36 } |
| 36 | 37 |
| 37 // Wrapper around ref-counted ExternalMountPoints that will be used to lazily | 38 // Wrapper around ref-counted ExternalMountPoints that will be used to lazily |
| 38 // create and initialize LazyInstance system ExternalMountPoints. | 39 // create and initialize LazyInstance system ExternalMountPoints. |
| 39 class SystemMountPointsLazyWrapper { | 40 class SystemMountPointsLazyWrapper { |
| 40 public: | 41 public: |
| 41 SystemMountPointsLazyWrapper() | 42 SystemMountPointsLazyWrapper() |
| 42 : system_mount_points_(fileapi::ExternalMountPoints::CreateRefCounted()) { | 43 : system_mount_points_(fileapi::ExternalMountPoints::CreateRefCounted()) { |
| 43 } | 44 } |
| 44 | 45 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 path.IsParent(potential_child->first)) { | 348 path.IsParent(potential_child->first)) { |
| 348 return false; | 349 return false; |
| 349 } | 350 } |
| 350 } | 351 } |
| 351 } | 352 } |
| 352 | 353 |
| 353 return true; | 354 return true; |
| 354 } | 355 } |
| 355 | 356 |
| 356 } // namespace fileapi | 357 } // namespace fileapi |
| OLD | NEW |