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/local_file_util.h" | 5 #include "webkit/fileapi/local_file_util.h" |
6 | 6 |
7 #include "base/files/file_util_proxy.h" | 7 #include "base/files/file_util_proxy.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "webkit/fileapi/file_system_context.h" | 9 #include "webkit/fileapi/file_system_context.h" |
10 #include "webkit/fileapi/file_system_mount_point_provider.h" | 10 #include "webkit/fileapi/file_system_mount_point_provider.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 PlatformFileError LocalFileUtil::DeleteDirectory( | 235 PlatformFileError LocalFileUtil::DeleteDirectory( |
236 FileSystemOperationContext* context, | 236 FileSystemOperationContext* context, |
237 const FileSystemURL& url) { | 237 const FileSystemURL& url) { |
238 base::FilePath file_path; | 238 base::FilePath file_path; |
239 PlatformFileError error = GetLocalFilePath(context, url, &file_path); | 239 PlatformFileError error = GetLocalFilePath(context, url, &file_path); |
240 if (error != base::PLATFORM_FILE_OK) | 240 if (error != base::PLATFORM_FILE_OK) |
241 return error; | 241 return error; |
242 return NativeFileUtil::DeleteDirectory(file_path); | 242 return NativeFileUtil::DeleteDirectory(file_path); |
243 } | 243 } |
244 | 244 |
245 base::PlatformFileError LocalFileUtil::CreateSnapshotFile( | 245 webkit_blob::ScopedFile LocalFileUtil::CreateSnapshotFile( |
246 FileSystemOperationContext* context, | 246 FileSystemOperationContext* context, |
247 const FileSystemURL& url, | 247 const FileSystemURL& url, |
| 248 base::PlatformFileError* error, |
248 base::PlatformFileInfo* file_info, | 249 base::PlatformFileInfo* file_info, |
249 base::FilePath* platform_path, | 250 base::FilePath* platform_path) { |
250 SnapshotFilePolicy* policy) { | |
251 DCHECK(policy); | |
252 DCHECK(file_info); | 251 DCHECK(file_info); |
253 // We're just returning the local file information. | 252 // We're just returning the local file information. |
254 *policy = kSnapshotFileLocal; | 253 *error = GetFileInfo(context, url, file_info, platform_path); |
255 base::PlatformFileError error = | 254 if (*error == base::PLATFORM_FILE_OK && file_info->is_directory) |
256 GetFileInfo(context, url, file_info, platform_path); | 255 *error = base::PLATFORM_FILE_ERROR_NOT_A_FILE; |
257 if (error == base::PLATFORM_FILE_OK && file_info->is_directory) | 256 return webkit_blob::ScopedFile(); |
258 return base::PLATFORM_FILE_ERROR_NOT_A_FILE; | |
259 return error; | |
260 } | 257 } |
261 | 258 |
262 } // namespace fileapi | 259 } // namespace fileapi |
OLD | NEW |