Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: components/feedback/feedback_report.cc

Issue 2920223002: Add additional histograms with suffixes to ImportantFileWriter. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/feedback/feedback_report.h" 5 #include "components/feedback/feedback_report.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/important_file_writer.h" 10 #include "base/files/important_file_writer.h"
(...skipping 11 matching lines...) Expand all
22 22
23 void WriteReportOnBlockingPool(const base::FilePath reports_path, 23 void WriteReportOnBlockingPool(const base::FilePath reports_path,
24 const base::FilePath& file, 24 const base::FilePath& file,
25 const std::string& data) { 25 const std::string& data) {
26 DCHECK(reports_path.IsParent(file)); 26 DCHECK(reports_path.IsParent(file));
27 if (!base::DirectoryExists(reports_path)) { 27 if (!base::DirectoryExists(reports_path)) {
28 base::File::Error error; 28 base::File::Error error;
29 if (!base::CreateDirectoryAndGetError(reports_path, &error)) 29 if (!base::CreateDirectoryAndGetError(reports_path, &error))
30 return; 30 return;
31 } 31 }
32 base::ImportantFileWriter::WriteFileAtomically(file, data); 32 base::ImportantFileWriter::WriteFileAtomically(
33 file, data, std::string(".FeedbackReport"));
33 } 34 }
34 35
35 } // namespace 36 } // namespace
36 37
37 namespace feedback { 38 namespace feedback {
38 39
39 FeedbackReport::FeedbackReport( 40 FeedbackReport::FeedbackReport(
40 const base::FilePath& path, 41 const base::FilePath& path,
41 const base::Time& upload_at, 42 const base::Time& upload_at,
42 const std::string& data, 43 const std::string& data,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 80
80 void FeedbackReport::DeleteReportOnDisk() { 81 void FeedbackReport::DeleteReportOnDisk() {
81 reports_task_runner_->PostTask( 82 reports_task_runner_->PostTask(
82 FROM_HERE, 83 FROM_HERE,
83 base::Bind(base::IgnoreResult(&base::DeleteFile), file_, false)); 84 base::Bind(base::IgnoreResult(&base::DeleteFile), file_, false));
84 } 85 }
85 86
86 FeedbackReport::~FeedbackReport() {} 87 FeedbackReport::~FeedbackReport() {}
87 88
88 } // namespace feedback 89 } // namespace feedback
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698