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/obfuscated_file_util.h" | 5 #include "webkit/fileapi/obfuscated_file_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 } | 884 } |
885 if (!db->RemoveFileInfo(file_id)) | 885 if (!db->RemoveFileInfo(file_id)) |
886 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; | 886 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; |
887 int64 growth = -UsageForPath(file_info.name.size()); | 887 int64 growth = -UsageForPath(file_info.name.size()); |
888 AllocateQuota(context, growth); | 888 AllocateQuota(context, growth); |
889 UpdateUsage(context, url.origin(), url.type(), growth); | 889 UpdateUsage(context, url.origin(), url.type(), growth); |
890 TouchDirectory(db, file_info.parent_id); | 890 TouchDirectory(db, file_info.parent_id); |
891 return base::PLATFORM_FILE_OK; | 891 return base::PLATFORM_FILE_OK; |
892 } | 892 } |
893 | 893 |
| 894 scoped_refptr<webkit_blob::ShareableFileReference> |
| 895 ObfuscatedFileUtil::CreateSnapshotFile( |
| 896 FileSystemOperationContext* context, |
| 897 const FileSystemURL& url, |
| 898 base::PlatformFileError* result, |
| 899 base::PlatformFileInfo* file_info, |
| 900 FilePath* platform_path) { |
| 901 DCHECK(result); |
| 902 *result = GetFileInfo(context, url, file_info, platform_path); |
| 903 return NULL; |
| 904 } |
| 905 |
894 FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType( | 906 FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType( |
895 const GURL& origin, | 907 const GURL& origin, |
896 FileSystemType type, | 908 FileSystemType type, |
897 bool create, | 909 bool create, |
898 base::PlatformFileError* error_code) { | 910 base::PlatformFileError* error_code) { |
899 FilePath origin_dir = GetDirectoryForOrigin(origin, create, error_code); | 911 FilePath origin_dir = GetDirectoryForOrigin(origin, create, error_code); |
900 if (origin_dir.empty()) | 912 if (origin_dir.empty()) |
901 return FilePath(); | 913 return FilePath(); |
902 FilePath::StringType type_string = GetDirectoryNameForType(type); | 914 FilePath::StringType type_string = GetDirectoryNameForType(type); |
903 if (type_string.empty()) { | 915 if (type_string.empty()) { |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 error = NativeFileUtil::CreateDirectory( | 1394 error = NativeFileUtil::CreateDirectory( |
1383 new_local_path, false /* exclusive */, false /* recursive */); | 1395 new_local_path, false /* exclusive */, false /* recursive */); |
1384 if (error != base::PLATFORM_FILE_OK) | 1396 if (error != base::PLATFORM_FILE_OK) |
1385 return error; | 1397 return error; |
1386 | 1398 |
1387 *local_path = new_local_path.AppendASCII(StringPrintf("%08" PRId64, number)); | 1399 *local_path = new_local_path.AppendASCII(StringPrintf("%08" PRId64, number)); |
1388 return base::PLATFORM_FILE_OK; | 1400 return base::PLATFORM_FILE_OK; |
1389 } | 1401 } |
1390 | 1402 |
1391 } // namespace fileapi | 1403 } // namespace fileapi |
OLD | NEW |