| 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 "storage/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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 void ExternalMountPoints::RevokeAllFileSystems() { | 248 void ExternalMountPoints::RevokeAllFileSystems() { |
| 249 NameToInstance instance_map_copy; | 249 NameToInstance instance_map_copy; |
| 250 { | 250 { |
| 251 base::AutoLock locker(lock_); | 251 base::AutoLock locker(lock_); |
| 252 instance_map_copy = instance_map_; | 252 instance_map_copy = instance_map_; |
| 253 instance_map_.clear(); | 253 instance_map_.clear(); |
| 254 path_to_name_map_.clear(); | 254 path_to_name_map_.clear(); |
| 255 } | 255 } |
| 256 STLDeleteContainerPairSecondPointers(instance_map_copy.begin(), | 256 base::STLDeleteContainerPairSecondPointers(instance_map_copy.begin(), |
| 257 instance_map_copy.end()); | 257 instance_map_copy.end()); |
| 258 } | 258 } |
| 259 | 259 |
| 260 ExternalMountPoints::ExternalMountPoints() {} | 260 ExternalMountPoints::ExternalMountPoints() {} |
| 261 | 261 |
| 262 ExternalMountPoints::~ExternalMountPoints() { | 262 ExternalMountPoints::~ExternalMountPoints() { |
| 263 STLDeleteContainerPairSecondPointers(instance_map_.begin(), | 263 base::STLDeleteContainerPairSecondPointers(instance_map_.begin(), |
| 264 instance_map_.end()); | 264 instance_map_.end()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 FileSystemURL ExternalMountPoints::CrackFileSystemURL( | 267 FileSystemURL ExternalMountPoints::CrackFileSystemURL( |
| 268 const FileSystemURL& url) const { | 268 const FileSystemURL& url) const { |
| 269 if (!HandlesFileSystemMountType(url.type())) | 269 if (!HandlesFileSystemMountType(url.type())) |
| 270 return FileSystemURL(); | 270 return FileSystemURL(); |
| 271 | 271 |
| 272 base::FilePath virtual_path = url.path(); | 272 base::FilePath virtual_path = url.path(); |
| 273 if (url.type() == kFileSystemTypeNativeForPlatformApp) { | 273 if (url.type() == kFileSystemTypeNativeForPlatformApp) { |
| 274 #if defined(OS_CHROMEOS) | 274 #if defined(OS_CHROMEOS) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 path.IsParent(potential_child->first)) { | 342 path.IsParent(potential_child->first)) { |
| 343 return false; | 343 return false; |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 return true; | 348 return true; |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace storage | 351 } // namespace storage |
| OLD | NEW |