| 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/file_system_directory_database.h" | 5 #include "webkit/fileapi/file_system_directory_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <math.h> | 8 #include <math.h> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 std::stack<FilePath> pending_directories; | 267 std::stack<FilePath> pending_directories; |
| 268 pending_directories.push(FilePath()); | 268 pending_directories.push(FilePath()); |
| 269 | 269 |
| 270 while (!pending_directories.empty()) { | 270 while (!pending_directories.empty()) { |
| 271 FilePath dir_path = pending_directories.top(); | 271 FilePath dir_path = pending_directories.top(); |
| 272 pending_directories.pop(); | 272 pending_directories.pop(); |
| 273 | 273 |
| 274 file_util::FileEnumerator file_enum( | 274 file_util::FileEnumerator file_enum( |
| 275 dir_path.empty() ? path_ : path_.Append(dir_path), | 275 dir_path.empty() ? path_ : path_.Append(dir_path), |
| 276 false /* recursive */, | 276 false /* recursive */, |
| 277 static_cast<file_util::FileEnumerator::FileType>( | 277 (file_util::FileEnumerator::DIRECTORIES | |
| 278 file_util::FileEnumerator::DIRECTORIES | | 278 file_util::FileEnumerator::FILES)); |
| 279 file_util::FileEnumerator::FILES)); | |
| 280 | 279 |
| 281 FilePath absolute_file_path; | 280 FilePath absolute_file_path; |
| 282 while (!(absolute_file_path = file_enum.Next()).empty()) { | 281 while (!(absolute_file_path = file_enum.Next()).empty()) { |
| 283 file_util::FileEnumerator::FindInfo find_info; | 282 file_util::FileEnumerator::FindInfo find_info; |
| 284 file_enum.GetFindInfo(&find_info); | 283 file_enum.GetFindInfo(&find_info); |
| 285 | 284 |
| 286 FilePath relative_file_path; | 285 FilePath relative_file_path; |
| 287 if (!path_.AppendRelativePath(absolute_file_path, &relative_file_path)) | 286 if (!path_.AppendRelativePath(absolute_file_path, &relative_file_path)) |
| 288 return false; | 287 return false; |
| 289 | 288 |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 | 862 |
| 864 void FileSystemDirectoryDatabase::HandleError( | 863 void FileSystemDirectoryDatabase::HandleError( |
| 865 const tracked_objects::Location& from_here, | 864 const tracked_objects::Location& from_here, |
| 866 const leveldb::Status& status) { | 865 const leveldb::Status& status) { |
| 867 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: " | 866 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: " |
| 868 << from_here.ToString() << " with error: " << status.ToString(); | 867 << from_here.ToString() << " with error: " << status.ToString(); |
| 869 db_.reset(); | 868 db_.reset(); |
| 870 } | 869 } |
| 871 | 870 |
| 872 } // namespace fileapi | 871 } // namespace fileapi |
| OLD | NEW |