Chromium Code Reviews| Index: components/feedback/anonymizer_tool.h |
| diff --git a/components/feedback/anonymizer_tool.h b/components/feedback/anonymizer_tool.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a65077296253826ca8d31363d69f8bf968ac06e4 |
| --- /dev/null |
| +++ b/components/feedback/anonymizer_tool.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_FEEDBACK_ANONYMIZER_TOOL_H_ |
| +#define COMPONENTS_FEEDBACK_ANONYMIZER_TOOL_H_ |
| + |
| +#include <map> |
| +#include <string> |
| +#include <vector> |
| + |
| +#include <base/macros.h> |
| + |
| +namespace feedback { |
| + |
| +class AnonymizerTool { |
| + public: |
| + AnonymizerTool(); |
| + ~AnonymizerTool(); |
| + |
| + // Returns an anonymized version of |input|. PII-sensitive data (such as MAC |
| + // addresses) in |input| is replaced with unique identifiers. |
| + std::string Anonymize(const std::string& input); |
| + |
| + private: |
| + friend class AnonymizerToolTest; |
| + |
| + std::string AnonymizeMACAddresses(const std::string& input); |
| + std::string AnonymizeCustomPatterns(const std::string& input); |
| + static std::string AnonymizeCustomPattern( |
| + const std::string& input, |
| + const std::string& pattern, |
| + std::map<std::string, std::string>* identifier_space); |
| + |
| + 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.
|
| + std::vector<std::map<std::string, std::string>> custom_patterns_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AnonymizerTool); |
| +}; |
| + |
| +} // namespace feedback |
| + |
| +#endif // COMPONENTS_FEEDBACK_ANONYMIZER_TOOL_H_ |