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 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ | 5 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ |
6 #define COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ | 6 #define COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... | |
41 | 41 |
42 // Determine if the given feedback value is small enough to not need to | 42 // Determine if the given feedback value is small enough to not need to |
43 // be compressed. | 43 // be compressed. |
44 static bool BelowCompressionThreshold(const std::string& content); | 44 static bool BelowCompressionThreshold(const std::string& content); |
45 | 45 |
46 FeedbackCommon(); | 46 FeedbackCommon(); |
47 | 47 |
48 void CompressFile(const base::FilePath& filename, | 48 void CompressFile(const base::FilePath& filename, |
49 const std::string& zipname, | 49 const std::string& zipname, |
50 scoped_ptr<std::string> data); | 50 scoped_ptr<std::string> data); |
51 // File attachments are not anonymized. It is the responsibility of the caller | |
52 // to remove personally identifying information by using the AnonymizerTool. | |
51 void AddFile(const std::string& filename, scoped_ptr<std::string> data); | 53 void AddFile(const std::string& filename, scoped_ptr<std::string> data); |
52 | 54 |
55 // Logs are anonymized via the AnonymizerTool. | |
53 void AddLog(const std::string& name, const std::string& value); | 56 void AddLog(const std::string& name, const std::string& value); |
54 void AddLogs(scoped_ptr<SystemLogsMap> logs); | 57 void AddLogs(scoped_ptr<SystemLogsMap> logs); |
55 void CompressLogs(); | 58 void CompressLogs(); |
56 | 59 |
57 void AddFilesAndLogsToReport( | 60 void AddFilesAndLogsToReport( |
58 userfeedback::ExtensionSubmit* feedback_data) const; | 61 userfeedback::ExtensionSubmit* feedback_data) const; |
59 | 62 |
60 // Fill in |feedback_data| with all the data that we have collected. | 63 // Fill in |feedback_data| with all the data that we have collected. |
61 // CompressLogs() must have already been called. | 64 // CompressLogs() must have already been called. |
65 // File attachments in the feedback data need to be properly anonymized before | |
vasilii
2015/12/17 12:40:37
The comment above says that the file attachments a
battre
2015/12/17 13:24:24
I don't understand. Neither AddFile nor PrepareRep
| |
66 // reporting using the AnonymizerTool. | |
62 void PrepareReport(userfeedback::ExtensionSubmit* feedback_data) const; | 67 void PrepareReport(userfeedback::ExtensionSubmit* feedback_data) const; |
63 | 68 |
64 // Getters | 69 // Getters |
65 const std::string& category_tag() const { return category_tag_; } | 70 const std::string& category_tag() const { return category_tag_; } |
66 const std::string& page_url() const { return page_url_; } | 71 const std::string& page_url() const { return page_url_; } |
67 const std::string& description() const { return description_; } | 72 const std::string& description() const { return description_; } |
68 const std::string& user_email() const { return user_email_; } | 73 const std::string& user_email() const { return user_email_; } |
69 const std::string* image() const { return image_.get(); } | 74 const std::string* image() const { return image_.get(); } |
70 const SystemLogsMap* sys_info() const { return logs_.get(); } | 75 const SystemLogsMap* sys_info() const { return logs_.get(); } |
71 int32_t product_id() const { return product_id_; } | 76 int32_t product_id() const { return product_id_; } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 | 117 |
113 // It is possible that multiple attachment add calls are running in | 118 // It is possible that multiple attachment add calls are running in |
114 // parallel, so synchronize access. | 119 // parallel, so synchronize access. |
115 base::Lock attachments_lock_; | 120 base::Lock attachments_lock_; |
116 ScopedVector<AttachedFile> attachments_; | 121 ScopedVector<AttachedFile> attachments_; |
117 | 122 |
118 scoped_ptr<SystemLogsMap> logs_; | 123 scoped_ptr<SystemLogsMap> logs_; |
119 }; | 124 }; |
120 | 125 |
121 #endif // COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ | 126 #endif // COMPONENTS_FEEDBACK_FEEDBACK_COMMON_H_ |
OLD | NEW |