| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 bool create) { | 107 bool create) { |
| 108 DCHECK_EQ(kFileSystemTypeTest, type); | 108 DCHECK_EQ(kFileSystemTypeTest, type); |
| 109 bool success = true; | 109 bool success = true; |
| 110 if (create) | 110 if (create) |
| 111 success = file_util::CreateDirectory(base_path_); | 111 success = file_util::CreateDirectory(base_path_); |
| 112 else | 112 else |
| 113 success = file_util::DirectoryExists(base_path_); | 113 success = file_util::DirectoryExists(base_path_); |
| 114 return success ? base_path_ : FilePath(); | 114 return success ? base_path_ : FilePath(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool TestMountPointProvider::IsAccessAllowed( | 117 bool TestMountPointProvider::IsAccessAllowed(const FileSystemURL& url) { |
| 118 const GURL& origin_url, FileSystemType type, const FilePath& virtual_path) { | 118 return url.type() == fileapi::kFileSystemTypeTest; |
| 119 return type == fileapi::kFileSystemTypeTest; | |
| 120 } | 119 } |
| 121 | 120 |
| 122 bool TestMountPointProvider::IsRestrictedFileName( | 121 bool TestMountPointProvider::IsRestrictedFileName( |
| 123 const FilePath& filename) const { | 122 const FilePath& filename) const { |
| 124 return false; | 123 return false; |
| 125 } | 124 } |
| 126 | 125 |
| 127 FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { | 126 FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { |
| 128 return local_file_util_.get(); | 127 return local_file_util_.get(); |
| 129 } | 128 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 FileSystemType type, | 164 FileSystemType type, |
| 166 FileSystemContext* context, | 165 FileSystemContext* context, |
| 167 const DeleteFileSystemCallback& callback) { | 166 const DeleteFileSystemCallback& callback) { |
| 168 // This won't be called unless we add test code that opens a test | 167 // This won't be called unless we add test code that opens a test |
| 169 // filesystem by OpenFileSystem. | 168 // filesystem by OpenFileSystem. |
| 170 NOTREACHED(); | 169 NOTREACHED(); |
| 171 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 170 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
| 172 } | 171 } |
| 173 | 172 |
| 174 } // namespace fileapi | 173 } // namespace fileapi |
| OLD | NEW |