| 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" |
| 11 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/stl_util.h" |
| 14 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 15 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
| 16 #include "base/sys_string_conversions.h" | 17 #include "base/sys_string_conversions.h" |
| 17 #include "base/stl_util.h" | |
| 18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 19 #include "webkit/fileapi/file_system_context.h" | 19 #include "webkit/fileapi/file_system_context.h" |
| 20 #include "webkit/fileapi/file_system_operation_context.h" | 20 #include "webkit/fileapi/file_system_operation_context.h" |
| 21 #include "webkit/fileapi/file_system_path_manager.h" | 21 #include "webkit/fileapi/file_system_path_manager.h" |
| 22 #include "webkit/fileapi/file_system_util.h" | 22 #include "webkit/fileapi/file_system_util.h" |
| 23 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 23 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const int64 kFlushDelaySeconds = 10 * 60; // 10 minutes | 27 const int64 kFlushDelaySeconds = 10 * 60; // 10 minutes |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, true); | 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::FileType>( |
| 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()) { |
| 911 file_util::FileEnumerator::FindInfo info; | 911 file_util::FileEnumerator::FindInfo info; |
| 912 file_enum.GetFindInfo(&info); | 912 file_enum.GetFindInfo(&info); |
| 913 FilePath relative_virtual_path = | 913 FilePath relative_virtual_path = |
| 914 FilePath(src_full_path.value().substr(root_path_length)); | 914 FilePath(src_full_path.value().substr(root_path_length)); |
| 915 if (relative_virtual_path.empty()) { | 915 if (relative_virtual_path.empty()) { |
| (...skipping 177 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 |