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/isolated_mount_point_provider.h" | 5 #include "webkit/fileapi/isolated_mount_point_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return isolated_context()->CrackIsolatedPath( | 86 return isolated_context()->CrackIsolatedPath( |
87 virtual_path, &filesystem_id, NULL, &path); | 87 virtual_path, &filesystem_id, NULL, &path); |
88 } | 88 } |
89 | 89 |
90 bool IsolatedMountPointProvider::IsRestrictedFileName( | 90 bool IsolatedMountPointProvider::IsRestrictedFileName( |
91 const FilePath& filename) const { | 91 const FilePath& filename) const { |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil() { | 95 FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil() { |
| 96 // TODO(kinuko): Return different FileUtil's based on types. |
96 return isolated_file_util_.get(); | 97 return isolated_file_util_.get(); |
97 } | 98 } |
98 | 99 |
99 FilePath IsolatedMountPointProvider::GetPathForPermissionsCheck( | 100 FilePath IsolatedMountPointProvider::GetPathForPermissionsCheck( |
100 const FilePath& virtual_path) const { | 101 const FilePath& virtual_path) const { |
101 std::string fsid; | 102 std::string fsid; |
102 FilePath path; | 103 FilePath path; |
103 if (!isolated_context()->CrackIsolatedPath(virtual_path, &fsid, NULL, &path)) | 104 if (!isolated_context()->CrackIsolatedPath(virtual_path, &fsid, NULL, &path)) |
104 return FilePath(); | 105 return FilePath(); |
105 return path; | 106 return path; |
(...skipping 23 matching lines...) Expand all Loading... |
129 FilePath path = GetPathFromURL(url); | 130 FilePath path = GetPathFromURL(url); |
130 return path.empty() ? NULL : new LocalFileStreamWriter(path, offset); | 131 return path.empty() ? NULL : new LocalFileStreamWriter(path, offset); |
131 } | 132 } |
132 | 133 |
133 FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { | 134 FileSystemQuotaUtil* IsolatedMountPointProvider::GetQuotaUtil() { |
134 // No quota support. | 135 // No quota support. |
135 return NULL; | 136 return NULL; |
136 } | 137 } |
137 | 138 |
138 } // namespace fileapi | 139 } // namespace fileapi |
OLD | NEW |