| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/feedback/feedback_report.h" | 5 #include "feedback_report.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file.h" |
| 8 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 9 #include "base/files/important_file_writer.h" | 10 #include "base/files/important_file_writer.h" |
| 10 #include "base/guid.h" | 11 #include "base/guid.h" |
| 12 #include "base/sequenced_task_runner.h" |
| 11 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "net/base/directory_lister.h" | |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 const base::FilePath::CharType kFeedbackReportFilenameWildcard[] = | 18 const base::FilePath::CharType kFeedbackReportFilenameWildcard[] = |
| 18 FILE_PATH_LITERAL("Feedback Report.*"); | 19 FILE_PATH_LITERAL("Feedback Report.*"); |
| 19 | 20 |
| 20 const char kFeedbackReportFilenamePrefix[] = "Feedback Report."; | 21 const char kFeedbackReportFilenamePrefix[] = "Feedback Report."; |
| 21 | 22 |
| 22 void WriteReportOnBlockingPool(const base::FilePath reports_path, | 23 void WriteReportOnBlockingPool(const base::FilePath reports_path, |
| 23 const base::FilePath& file, | 24 const base::FilePath& file, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 !name.empty(); | 75 !name.empty(); |
| 75 name = enumerator.Next()) { | 76 name = enumerator.Next()) { |
| 76 std::string data; | 77 std::string data; |
| 77 if (ReadFileToString(name, &data)) | 78 if (ReadFileToString(name, &data)) |
| 78 callback.Run(data); | 79 callback.Run(data); |
| 79 base::DeleteFile(name, false); | 80 base::DeleteFile(name, false); |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace feedback | 84 } // namespace feedback |
| OLD | NEW |