| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/fileapi/file_system_path_manager.h" | 5 #include "webkit/fileapi/file_system_path_manager.h" |
| 6 | 6 |
| 7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_callback_factory.h" | 9 #include "base/memory/scoped_callback_factory.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
| 50 external_provider_.reset( | 50 external_provider_.reset( |
| 51 new chromeos::CrosMountPointProvider(special_storage_policy)); | 51 new chromeos::CrosMountPointProvider(special_storage_policy)); |
| 52 #endif | 52 #endif |
| 53 } | 53 } |
| 54 | 54 |
| 55 FileSystemPathManager::~FileSystemPathManager() {} | 55 FileSystemPathManager::~FileSystemPathManager() {} |
| 56 | 56 |
| 57 void FileSystemPathManager::GetFileSystemRootPath( | 57 void FileSystemPathManager::GetFileSystemRootPath( |
| 58 const GURL& origin_url, fileapi::FileSystemType type, | 58 const GURL& origin_url, fileapi::FileSystemType type, |
| 59 bool create, GetRootPathCallback* callback_ptr) { | 59 bool create, bool is_file_system, |
| 60 const FilePath& virtual_path, |
| 61 GetRootPathCallback* callback_ptr) { |
| 60 | 62 |
| 61 switch (type) { | 63 switch (type) { |
| 62 case kFileSystemTypeTemporary: | 64 case kFileSystemTypeTemporary: |
| 63 case kFileSystemTypePersistent: | 65 case kFileSystemTypePersistent: |
| 64 sandbox_provider_->GetFileSystemRootPath( | 66 sandbox_provider_->GetFileSystemRootPath( |
| 65 origin_url, type, create, callback_ptr); | 67 origin_url, type, create, is_file_system, virtual_path, callback_ptr); |
| 66 break; | 68 break; |
| 67 case kFileSystemTypeExternal: | 69 case kFileSystemTypeExternal: |
| 68 if (external_provider_.get()) { | 70 if (external_provider_.get()) { |
| 69 external_provider_->GetFileSystemRootPath( | 71 external_provider_->GetFileSystemRootPath( |
| 70 origin_url, type, create, callback_ptr); | 72 origin_url, type, create, is_file_system, virtual_path, callback_ptr); |
| 71 } else { | 73 } else { |
| 72 callback_ptr->Run(false, FilePath(), std::string()); | 74 callback_ptr->Run(false, FilePath(), std::string()); |
| 73 } | 75 } |
| 74 break; | 76 break; |
| 75 case kFileSystemTypeUnknown: | 77 case kFileSystemTypeUnknown: |
| 76 default: | 78 default: |
| 77 NOTREACHED(); | 79 NOTREACHED(); |
| 78 callback_ptr->Run(false, FilePath(), std::string()); | 80 callback_ptr->Run(false, FilePath(), std::string()); |
| 79 } | 81 } |
| 80 } | 82 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 163 } |
| 162 | 164 |
| 163 } // namespace fileapi | 165 } // namespace fileapi |
| 164 | 166 |
| 165 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ | 167 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ |
| 166 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); | 168 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); |
| 167 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ | 169 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ |
| 168 int(fileapi::kFileSystemTypePersistent), mismatching_enums); | 170 int(fileapi::kFileSystemTypePersistent), mismatching_enums); |
| 169 COMPILE_ASSERT(int(WebFileSystem::TypeExternal) == \ | 171 COMPILE_ASSERT(int(WebFileSystem::TypeExternal) == \ |
| 170 int(fileapi::kFileSystemTypeExternal), mismatching_enums); | 172 int(fileapi::kFileSystemTypeExternal), mismatching_enums); |
| OLD | NEW |