Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_FEEDBACK_ANONYMIZER_TOOL_H_ | |
| 6 #define COMPONENTS_FEEDBACK_ANONYMIZER_TOOL_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include <base/macros.h> | |
| 13 | |
| 14 namespace feedback { | |
| 15 | |
| 16 class AnonymizerTool { | |
| 17 public: | |
| 18 AnonymizerTool(); | |
| 19 ~AnonymizerTool(); | |
| 20 | |
| 21 // Returns an anonymized version of |input|. PII-sensitive data (such as MAC | |
| 22 // addresses) in |input| is replaced with unique identifiers. | |
| 23 std::string Anonymize(const std::string& input); | |
| 24 | |
| 25 private: | |
| 26 friend class AnonymizerToolTest; | |
| 27 | |
| 28 std::string AnonymizeMACAddresses(const std::string& input); | |
| 29 std::string AnonymizeCustomPatterns(const std::string& input); | |
| 30 static std::string AnonymizeCustomPattern( | |
| 31 const std::string& input, | |
| 32 const std::string& pattern, | |
| 33 std::map<std::string, std::string>* identifier_space); | |
| 34 | |
| 35 std::map<std::string, std::string> mac_addresses_; | |
|
vasilii
2015/12/17 12:40:37
Comments needed here.
battre
2015/12/17 13:24:24
Done.
| |
| 36 std::vector<std::map<std::string, std::string>> custom_patterns_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(AnonymizerTool); | |
| 39 }; | |
| 40 | |
| 41 } // namespace feedback | |
| 42 | |
| 43 #endif // COMPONENTS_FEEDBACK_ANONYMIZER_TOOL_H_ | |
| OLD | NEW |