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

Unified Diff: components/feedback/feedback_common.cc

Issue 2242833003: Add the most recent crash report IDs to feedback reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RFR Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/feedback/feedback_common.cc
diff --git a/components/feedback/feedback_common.cc b/components/feedback/feedback_common.cc
index fdb0c560084a041c1a043b0f7c158c28c80e3c7f..b51c59383cbc570ead23de33ede2971825d204b8 100644
--- a/components/feedback/feedback_common.cc
+++ b/components/feedback/feedback_common.cc
@@ -22,24 +22,27 @@ constexpr int kChromeOSProductId = 208;
constexpr int kChromeBrowserProductId = 237;
#endif
-const char kMultilineIndicatorString[] = "<multiline>\n";
-const char kMultilineStartString[] = "---------- START ----------\n";
-const char kMultilineEndString[] = "---------- END ----------\n\n";
+constexpr char kMultilineIndicatorString[] = "<multiline>\n";
+constexpr char kMultilineStartString[] = "---------- START ----------\n";
+constexpr char kMultilineEndString[] = "---------- END ----------\n\n";
// The below thresholds were chosen arbitrarily to conveniently show small data
// as part of the report itself without having to look into the system_logs.zip
// file.
-const size_t kFeedbackMaxLength = 1024;
-const size_t kFeedbackMaxLineCount = 10;
+constexpr size_t kFeedbackMaxLength = 1024;
+constexpr size_t kFeedbackMaxLineCount = 10;
-const base::FilePath::CharType kLogsFilename[] =
+constexpr base::FilePath::CharType kLogsFilename[] =
FILE_PATH_LITERAL("system_logs.txt");
-const char kLogsAttachmentName[] = "system_logs.zip";
+constexpr char kLogsAttachmentName[] = "system_logs.zip";
-const char kZipExt[] = ".zip";
+constexpr char kZipExt[] = ".zip";
-const char kPngMimeType[] = "image/png";
-const char kArbitraryMimeType[] = "application/octet-stream";
+constexpr char kPngMimeType[] = "image/png";
+constexpr char kArbitraryMimeType[] = "application/octet-stream";
+
+// The ID of the product specific data as stored by the feedback server.
+constexpr char kCrashReportIds[] = "crash_report_ids";
Rahul Chaturvedi 2016/09/08 19:58:24 Can this be made global and used from the crash re
afakhry 2016/09/09 22:20:10 I couldn't agree more! Thanks! Done. :)
// Determine if the given feedback value is small enough to not need to
// be compressed.
@@ -66,6 +69,11 @@ std::unique_ptr<std::string> LogsToString(
base::TrimString(key, "\n ", &key);
base::TrimString(value, "\n ", &value);
+ // We must avoid adding the crash IDs to the system_logs.txt file for
+ // privacy reasons. They should just be part of the product specific data.
+ if (key == kCrashReportIds)
+ continue;
+
if (value.find("\n") != std::string::npos) {
syslogs_string->append(key + "=" + kMultilineIndicatorString +
kMultilineStartString + value + "\n" +
@@ -234,6 +242,7 @@ void FeedbackCommon::CompressLogs() {
std::move(logs));
}
}
+
void FeedbackCommon::AddFilesAndLogsToReport(
userfeedback::ExtensionSubmit* feedback_data) const {
for (size_t i = 0; i < attachments(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698