| 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 "webkit/fileapi/test_mount_point_provider.h" | 5 #include "webkit/fileapi/test_mount_point_provider.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 bool create) { | 94 bool create) { |
| 95 DCHECK_EQ(kFileSystemTypeTest, url.type()); | 95 DCHECK_EQ(kFileSystemTypeTest, url.type()); |
| 96 bool success = true; | 96 bool success = true; |
| 97 if (create) | 97 if (create) |
| 98 success = file_util::CreateDirectory(base_path_); | 98 success = file_util::CreateDirectory(base_path_); |
| 99 else | 99 else |
| 100 success = file_util::DirectoryExists(base_path_); | 100 success = file_util::DirectoryExists(base_path_); |
| 101 return success ? base_path_ : base::FilePath(); | 101 return success ? base_path_ : base::FilePath(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool TestMountPointProvider::IsAccessAllowed(const FileSystemURL& url) { | |
| 105 return url.type() == fileapi::kFileSystemTypeTest; | |
| 106 } | |
| 107 | |
| 108 bool TestMountPointProvider::IsRestrictedFileName( | |
| 109 const base::FilePath& filename) const { | |
| 110 return false; | |
| 111 } | |
| 112 | |
| 113 FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { | 104 FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { |
| 114 DCHECK(local_file_util_.get()); | 105 DCHECK(local_file_util_.get()); |
| 115 return local_file_util_->sync_file_util(); | 106 return local_file_util_->sync_file_util(); |
| 116 } | 107 } |
| 117 | 108 |
| 118 AsyncFileUtil* TestMountPointProvider::GetAsyncFileUtil(FileSystemType type) { | 109 AsyncFileUtil* TestMountPointProvider::GetAsyncFileUtil(FileSystemType type) { |
| 119 return local_file_util_.get(); | 110 return local_file_util_.get(); |
| 120 } | 111 } |
| 121 | 112 |
| 122 FilePermissionPolicy TestMountPointProvider::GetPermissionPolicy( | 113 FilePermissionPolicy TestMountPointProvider::GetPermissionPolicy( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 NOTREACHED(); | 155 NOTREACHED(); |
| 165 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 156 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
| 166 } | 157 } |
| 167 | 158 |
| 168 const UpdateObserverList* TestMountPointProvider::GetUpdateObservers( | 159 const UpdateObserverList* TestMountPointProvider::GetUpdateObservers( |
| 169 FileSystemType type) const { | 160 FileSystemType type) const { |
| 170 return &observers_; | 161 return &observers_; |
| 171 } | 162 } |
| 172 | 163 |
| 173 } // namespace fileapi | 164 } // namespace fileapi |
| OLD | NEW |