| 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 #include <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 return file_system_context_->GetMountPointProvider(type); | 229 return file_system_context_->GetMountPointProvider(type); |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool GetRootPath(const GURL& origin_url, | 232 bool GetRootPath(const GURL& origin_url, |
| 233 fileapi::FileSystemType type, | 233 fileapi::FileSystemType type, |
| 234 bool create, | 234 bool create, |
| 235 FilePath* root_path) { | 235 FilePath* root_path) { |
| 236 FilePath virtual_path = FilePath(); | 236 FilePath virtual_path = FilePath(); |
| 237 if (type == kFileSystemTypeExternal) | 237 if (type == kFileSystemTypeExternal) |
| 238 virtual_path = FilePath(kVirtualPath); | 238 virtual_path = FilePath(kVirtualPath); |
| 239 FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( |
| 240 origin_url, type, virtual_path); |
| 239 FilePath returned_root_path = | 241 FilePath returned_root_path = |
| 240 provider(type)->GetFileSystemRootPathOnFileThread( | 242 provider(type)->GetFileSystemRootPathOnFileThread(url, create); |
| 241 FileSystemURL(origin_url, type, virtual_path), create); | |
| 242 if (root_path) | 243 if (root_path) |
| 243 *root_path = returned_root_path; | 244 *root_path = returned_root_path; |
| 244 return !returned_root_path.empty(); | 245 return !returned_root_path.empty(); |
| 245 } | 246 } |
| 246 | 247 |
| 247 FilePath data_path() const { return data_dir_.path(); } | 248 FilePath data_path() const { return data_dir_.path(); } |
| 248 FilePath file_system_path() const { | 249 FilePath file_system_path() const { |
| 249 return data_dir_.path().Append( | 250 return data_dir_.path().Append( |
| 250 SandboxMountPointProvider::kFileSystemDirectory); | 251 SandboxMountPointProvider::kFileSystemDirectory); |
| 251 } | 252 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 FilePath virtual_unused; | 407 FilePath virtual_unused; |
| 407 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), | 408 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), |
| 408 &virtual_unused)); | 409 &virtual_unused)); |
| 409 external_provider->RemoveMountPoint(FilePath(kMountPoint)); | 410 external_provider->RemoveMountPoint(FilePath(kMountPoint)); |
| 410 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), | 411 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), |
| 411 &virtual_unused)); | 412 &virtual_unused)); |
| 412 } | 413 } |
| 413 #endif | 414 #endif |
| 414 | 415 |
| 415 } // namespace fileapi | 416 } // namespace fileapi |
| OLD | NEW |