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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 break; | 966 break; |
967 case kFileSystemTypePersistent: | 967 case kFileSystemTypePersistent: |
968 other_type = kFileSystemTypeTemporary; | 968 other_type = kFileSystemTypeTemporary; |
969 break; | 969 break; |
970 // These types shouldn't be used. | 970 // These types shouldn't be used. |
971 case kFileSystemTypeUnknown: | 971 case kFileSystemTypeUnknown: |
972 case kFileSystemTypeIsolated: | 972 case kFileSystemTypeIsolated: |
973 case kFileSystemTypeExternal: | 973 case kFileSystemTypeExternal: |
974 case kFileSystemTypeTest: | 974 case kFileSystemTypeTest: |
975 case kFileSystemTypeDragged: | 975 case kFileSystemTypeDragged: |
| 976 case kFileSystemTypeDeviceMedia: |
976 NOTREACHED(); | 977 NOTREACHED(); |
977 } | 978 } |
978 if (!file_util::DirectoryExists( | 979 if (!file_util::DirectoryExists( |
979 origin_path.Append(GetDirectoryNameForType(other_type)))) { | 980 origin_path.Append(GetDirectoryNameForType(other_type)))) { |
980 InitOriginDatabase(false); | 981 InitOriginDatabase(false); |
981 if (origin_database_.get()) | 982 if (origin_database_.get()) |
982 origin_database_->RemovePathForOrigin(GetOriginIdentifierFromURL(origin)); | 983 origin_database_->RemovePathForOrigin(GetOriginIdentifierFromURL(origin)); |
983 if (!file_util::Delete(origin_path, true /* recursive */)) | 984 if (!file_util::Delete(origin_path, true /* recursive */)) |
984 return false; | 985 return false; |
985 } | 986 } |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 error = NativeFileUtil::CreateDirectory( | 1397 error = NativeFileUtil::CreateDirectory( |
1397 new_local_path, false /* exclusive */, false /* recursive */); | 1398 new_local_path, false /* exclusive */, false /* recursive */); |
1398 if (error != base::PLATFORM_FILE_OK) | 1399 if (error != base::PLATFORM_FILE_OK) |
1399 return error; | 1400 return error; |
1400 | 1401 |
1401 *local_path = new_local_path.AppendASCII(StringPrintf("%08" PRId64, number)); | 1402 *local_path = new_local_path.AppendASCII(StringPrintf("%08" PRId64, number)); |
1402 return base::PLATFORM_FILE_OK; | 1403 return base::PLATFORM_FILE_OK; |
1403 } | 1404 } |
1404 | 1405 |
1405 } // namespace fileapi | 1406 } // namespace fileapi |
OLD | NEW |