| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_system_file_util.h" | 5 #include "webkit/fileapi/obfuscated_file_system_file_util.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 } | 890 } |
| 891 | 891 |
| 892 bool ObfuscatedFileSystemFileUtil::MigrateFromOldSandbox( | 892 bool ObfuscatedFileSystemFileUtil::MigrateFromOldSandbox( |
| 893 const GURL& origin_url, FileSystemType type, const FilePath& src_root) { | 893 const GURL& origin_url, FileSystemType type, const FilePath& src_root) { |
| 894 if (!DestroyDirectoryDatabase(origin_url, type)) | 894 if (!DestroyDirectoryDatabase(origin_url, type)) |
| 895 return false; | 895 return false; |
| 896 FilePath dest_root = GetDirectoryForOriginAndType(origin_url, type, true); | 896 FilePath dest_root = GetDirectoryForOriginAndType(origin_url, type, true); |
| 897 if (dest_root.empty()) | 897 if (dest_root.empty()) |
| 898 return false; | 898 return false; |
| 899 FileSystemDirectoryDatabase* db = GetDirectoryDatabase( | 899 FileSystemDirectoryDatabase* db = GetDirectoryDatabase( |
| 900 origin_url, type, false); | 900 origin_url, type, true); |
| 901 if (!db) | 901 if (!db) |
| 902 return false; | 902 return false; |
| 903 | 903 |
| 904 file_util::FileEnumerator file_enum(src_root, true, | 904 file_util::FileEnumerator file_enum(src_root, true, |
| 905 static_cast<file_util::FileEnumerator::FILE_TYPE>( | 905 static_cast<file_util::FileEnumerator::FILE_TYPE>( |
| 906 file_util::FileEnumerator::FILES | | 906 file_util::FileEnumerator::FILES | |
| 907 file_util::FileEnumerator::DIRECTORIES)); | 907 file_util::FileEnumerator::DIRECTORIES)); |
| 908 FilePath src_full_path; | 908 FilePath src_full_path; |
| 909 size_t root_path_length = src_root.value().length() + 1; // +1 for the slash | 909 size_t root_path_length = src_root.value().length() + 1; // +1 for the slash |
| 910 while (!(src_full_path = file_enum.Next()).empty()) { | 910 while (!(src_full_path = file_enum.Next()).empty()) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 return false; | 1093 return false; |
| 1094 } | 1094 } |
| 1095 origin_database_.reset( | 1095 origin_database_.reset( |
| 1096 new FileSystemOriginDatabase( | 1096 new FileSystemOriginDatabase( |
| 1097 file_system_directory_.AppendASCII(kOriginDatabaseName))); | 1097 file_system_directory_.AppendASCII(kOriginDatabaseName))); |
| 1098 } | 1098 } |
| 1099 return true; | 1099 return true; |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 } // namespace fileapi | 1102 } // namespace fileapi |
| OLD | NEW |