| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 const FilePath& filename) const { | 96 const FilePath& filename) const { |
| 97 // TODO(kinuko): We need to check platform-specific restricted file names | 97 // TODO(kinuko): We need to check platform-specific restricted file names |
| 98 // before we actually start allowing file creation in isolated file systems. | 98 // before we actually start allowing file creation in isolated file systems. |
| 99 return false; | 99 return false; |
| 100 } | 100 } |
| 101 | 101 |
| 102 FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil( | 102 FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil( |
| 103 FileSystemType type) { | 103 FileSystemType type) { |
| 104 switch (type) { | 104 switch (type) { |
| 105 case kFileSystemTypeIsolated: | 105 case kFileSystemTypeIsolated: |
| 106 case kFileSystemTypeNativeLocal: |
| 106 return isolated_file_util_.get(); | 107 return isolated_file_util_.get(); |
| 107 case kFileSystemTypeDragged: | 108 case kFileSystemTypeDragged: |
| 108 return dragged_file_util_.get(); | 109 return dragged_file_util_.get(); |
| 109 case kFileSystemTypeNativeMedia: | 110 case kFileSystemTypeNativeMedia: |
| 110 return native_media_file_util_.get(); | 111 return native_media_file_util_.get(); |
| 111 case kFileSystemTypeDeviceMedia: | 112 case kFileSystemTypeDeviceMedia: |
| 112 #if defined(SUPPORT_MEDIA_FILESYSTEM) | 113 #if defined(SUPPORT_MEDIA_FILESYSTEM) |
| 113 return device_media_file_util_.get(); | 114 return device_media_file_util_.get(); |
| 114 #endif | 115 #endif |
| 115 | 116 |
| 116 case kFileSystemTypeTemporary: | 117 default: |
| 117 case kFileSystemTypePersistent: | |
| 118 case kFileSystemTypeExternal: | |
| 119 case kFileSystemTypeTest: | |
| 120 case kFileSystemTypeUnknown: | |
| 121 NOTREACHED(); | 118 NOTREACHED(); |
| 122 } | 119 } |
| 123 return NULL; | 120 return NULL; |
| 124 } | 121 } |
| 125 | 122 |
| 126 FilePath IsolatedMountPointProvider::GetPathForPermissionsCheck( | 123 FilePath IsolatedMountPointProvider::GetPathForPermissionsCheck( |
| 127 const FilePath& virtual_path) const { | 124 const FilePath& virtual_path) const { |
| 128 // For isolated filesystems we only check per-filesystem permissions. | 125 // For isolated filesystems we only check per-filesystem permissions. |
| 129 NOTREACHED(); | 126 return FilePath(); |
| 130 return virtual_path; | |
| 131 } | 127 } |
| 132 | 128 |
| 133 FileSystemOperationInterface* | 129 FileSystemOperationInterface* |
| 134 IsolatedMountPointProvider::CreateFileSystemOperation( | 130 IsolatedMountPointProvider::CreateFileSystemOperation( |
| 135 const FileSystemURL& url, | 131 const FileSystemURL& url, |
| 136 FileSystemContext* context) const { | 132 FileSystemContext* context) const { |
| 137 scoped_ptr<FileSystemOperationContext> operation_context( | 133 scoped_ptr<FileSystemOperationContext> operation_context( |
| 138 new FileSystemOperationContext(context)); | 134 new FileSystemOperationContext(context)); |
| 139 if (url.type() == kFileSystemTypeNativeMedia || | 135 if (url.type() == kFileSystemTypeNativeMedia || |
| 140 url.type() == kFileSystemTypeDeviceMedia) { | 136 url.type() == kFileSystemTypeDeviceMedia) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 void IsolatedMountPointProvider::DeleteFileSystem( | 174 void IsolatedMountPointProvider::DeleteFileSystem( |
| 179 const GURL& origin_url, | 175 const GURL& origin_url, |
| 180 FileSystemType type, | 176 FileSystemType type, |
| 181 FileSystemContext* context, | 177 FileSystemContext* context, |
| 182 const DeleteFileSystemCallback& callback) { | 178 const DeleteFileSystemCallback& callback) { |
| 183 NOTREACHED(); | 179 NOTREACHED(); |
| 184 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 180 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
| 185 } | 181 } |
| 186 | 182 |
| 187 } // namespace fileapi | 183 } // namespace fileapi |
| OLD | NEW |