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/chromeos/fileapi/cros_mount_point_provider.h" | 5 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 return root_dirs; | 228 return root_dirs; |
229 } | 229 } |
230 | 230 |
231 fileapi::FileSystemFileUtil* CrosMountPointProvider::GetFileUtil( | 231 fileapi::FileSystemFileUtil* CrosMountPointProvider::GetFileUtil( |
232 fileapi::FileSystemType type) { | 232 fileapi::FileSystemType type) { |
233 DCHECK(type == fileapi::kFileSystemTypeNativeLocal || | 233 DCHECK(type == fileapi::kFileSystemTypeNativeLocal || |
234 type == fileapi::kFileSystemTypeRestrictedNativeLocal); | 234 type == fileapi::kFileSystemTypeRestrictedNativeLocal); |
235 return local_file_util_.get(); | 235 return local_file_util_.get(); |
236 } | 236 } |
237 | 237 |
238 FilePath CrosMountPointProvider::GetPathForPermissionsCheck( | 238 fileapi::FilePermissionPolicy CrosMountPointProvider::GetPermissionPolicy( |
239 const FilePath& virtual_path) const { | 239 const fileapi::FileSystemURL& url, int permissions) const { |
240 return virtual_path; | 240 if (url.mount_type() == fileapi::kFileSystemTypeIsolated) { |
| 241 // Permissions in isolated filesystems should be examined with |
| 242 // FileSystem permission. |
| 243 return fileapi::FILE_PERMISSION_USE_FILESYSTEM_PERMISSION; |
| 244 } |
| 245 return fileapi::FILE_PERMISSION_USE_FILE_PERMISSION; |
241 } | 246 } |
242 | 247 |
243 fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation( | 248 fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation( |
244 const fileapi::FileSystemURL& url, | 249 const fileapi::FileSystemURL& url, |
245 fileapi::FileSystemContext* context, | 250 fileapi::FileSystemContext* context, |
246 base::PlatformFileError* error_code) const { | 251 base::PlatformFileError* error_code) const { |
247 if (url.type() == fileapi::kFileSystemTypeDrive) { | 252 if (url.type() == fileapi::kFileSystemTypeDrive) { |
248 base::AutoLock locker(mount_point_map_lock_); | 253 base::AutoLock locker(mount_point_map_lock_); |
249 RemoteProxyMap::const_iterator found = remote_proxy_map_.find( | 254 RemoteProxyMap::const_iterator found = remote_proxy_map_.find( |
250 url.filesystem_id()); | 255 url.filesystem_id()); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 316 } |
312 return iter->first.DirName().AppendRelativePath( | 317 return iter->first.DirName().AppendRelativePath( |
313 filesystem_path, virtual_path); | 318 filesystem_path, virtual_path); |
314 } | 319 } |
315 | 320 |
316 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { | 321 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { |
317 return fileapi::IsolatedContext::GetInstance(); | 322 return fileapi::IsolatedContext::GetInstance(); |
318 } | 323 } |
319 | 324 |
320 } // namespace chromeos | 325 } // namespace chromeos |
OLD | NEW |