| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 fileapi::FileSystemType type) { | 208 fileapi::FileSystemType type) { |
| 209 DCHECK(type == fileapi::kFileSystemTypeNativeLocal); | 209 DCHECK(type == fileapi::kFileSystemTypeNativeLocal); |
| 210 return local_file_util_.get(); | 210 return local_file_util_.get(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 FilePath CrosMountPointProvider::GetPathForPermissionsCheck( | 213 FilePath CrosMountPointProvider::GetPathForPermissionsCheck( |
| 214 const FilePath& virtual_path) const { | 214 const FilePath& virtual_path) const { |
| 215 return virtual_path; | 215 return virtual_path; |
| 216 } | 216 } |
| 217 | 217 |
| 218 fileapi::FileSystemOperationInterface* | 218 fileapi::FileSystemOperation* CrosMountPointProvider::CreateFileSystemOperation( |
| 219 CrosMountPointProvider::CreateFileSystemOperation( | |
| 220 const fileapi::FileSystemURL& url, | 219 const fileapi::FileSystemURL& url, |
| 221 fileapi::FileSystemContext* context) const { | 220 fileapi::FileSystemContext* context) const { |
| 222 if (url.type() == fileapi::kFileSystemTypeDrive) { | 221 if (url.type() == fileapi::kFileSystemTypeDrive) { |
| 223 base::AutoLock locker(mount_point_map_lock_); | 222 base::AutoLock locker(mount_point_map_lock_); |
| 224 RemoteProxyMap::const_iterator found = remote_proxy_map_.find( | 223 RemoteProxyMap::const_iterator found = remote_proxy_map_.find( |
| 225 url.filesystem_id()); | 224 url.filesystem_id()); |
| 226 // TODO(kinuko): we should handle not-found case gracefully. | 225 // TODO(kinuko): we should handle not-found case gracefully. |
| 227 // http://crbug.com/141617 | 226 // 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); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 278 } |
| 280 return iter->first.DirName().AppendRelativePath( | 279 return iter->first.DirName().AppendRelativePath( |
| 281 filesystem_path, virtual_path); | 280 filesystem_path, virtual_path); |
| 282 } | 281 } |
| 283 | 282 |
| 284 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { | 283 fileapi::IsolatedContext* CrosMountPointProvider::isolated_context() const { |
| 285 return fileapi::IsolatedContext::GetInstance(); | 284 return fileapi::IsolatedContext::GetInstance(); |
| 286 } | 285 } |
| 287 | 286 |
| 288 } // namespace chromeos | 287 } // namespace chromeos |
| OLD | NEW |