Chromium Code Reviews| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 return local_file_util_.get(); | 211 return local_file_util_.get(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 FilePath CrosMountPointProvider::GetPathForPermissionsCheck( | 214 FilePath CrosMountPointProvider::GetPathForPermissionsCheck( |
| 215 const FilePath& virtual_path) const { | 215 const FilePath& virtual_path) const { |
| 216 return virtual_path; | 216 return virtual_path; |
| 217 } | 217 } |
| 218 | 218 |
| 219 fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation( | 219 fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation( |
| 220 const fileapi::FileSystemURL& url, | 220 const fileapi::FileSystemURL& url, |
| 221 fileapi::FileSystemContext* context) const { | 221 fileapi::FileSystemContext* context, |
| 222 base::PlatformFileError* error_code) const { | |
| 222 if (url.type() == fileapi::kFileSystemTypeDrive) { | 223 if (url.type() == fileapi::kFileSystemTypeDrive) { |
| 223 base::AutoLock locker(mount_point_map_lock_); | 224 base::AutoLock locker(mount_point_map_lock_); |
| 224 RemoteProxyMap::const_iterator found = remote_proxy_map_.find( | 225 RemoteProxyMap::const_iterator found = remote_proxy_map_.find( |
| 225 url.filesystem_id()); | 226 url.filesystem_id()); |
| 226 // TODO(kinuko): we should handle not-found case gracefully. | |
| 227 // http://crbug.com/141617 | |
| 228 if (found != remote_proxy_map_.end()) { | 227 if (found != remote_proxy_map_.end()) { |
| 229 return new chromeos::RemoteFileSystemOperation(found->second); | 228 return new chromeos::RemoteFileSystemOperation(found->second); |
| 229 } else { | |
|
kinuko
2012/09/11 05:01:39
nit: no need of else (since we're returning in if)
kmadhusu
2012/09/11 15:11:42
You had a TODO to handle the not-found case gracef
| |
| 230 *error_code = base::PLATFORM_FILE_ERROR_NOT_FOUND; | |
| 231 return NULL; | |
| 230 } | 232 } |
| 231 } | 233 } |
| 232 | 234 |
| 233 DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal); | 235 DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal); |
| 234 scoped_ptr<fileapi::FileSystemOperationContext> operation_context( | 236 scoped_ptr<fileapi::FileSystemOperationContext> operation_context( |
| 235 new fileapi::FileSystemOperationContext(context)); | 237 new fileapi::FileSystemOperationContext(context)); |
| 236 return new fileapi::LocalFileSystemOperation(context, | 238 return new fileapi::LocalFileSystemOperation(context, |
| 237 operation_context.Pass()); | 239 operation_context.Pass()); |
| 238 } | 240 } |
| 239 | 241 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 } | 281 } |
| 280 return iter->first.DirName().AppendRelativePath( | 282 return iter->first.DirName().AppendRelativePath( |
| 281 filesystem_path, virtual_path); | 283 filesystem_path, virtual_path); |
| 282 } | 284 } |
| 283 | 285 |
| 284 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { | 286 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { |
| 285 return fileapi::IsolatedContext::GetInstance(); | 287 return fileapi::IsolatedContext::GetInstance(); |
| 286 } | 288 } |
| 287 | 289 |
| 288 } // namespace chromeos | 290 } // namespace chromeos |
| OLD | NEW |