Chromium Code Reviews| Index: components/autofill/core/common/signatures_util.h |
| diff --git a/components/autofill/core/common/signatures_util.h b/components/autofill/core/common/signatures_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a5857d1d61d0c28a5006f1b88e904a1c3b1fbf28 |
| --- /dev/null |
| +++ b/components/autofill/core/common/signatures_util.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2016 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_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_ |
| +#define COMPONENTS_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_ |
| + |
| +#include <stddef.h> |
| + |
| +#include <stdint.h> |
| +#include <vector> |
|
vabr (Chromium)
2016/09/08 09:13:24
You don't seem to need <vector> in the header.
kolos1
2016/09/08 09:41:39
Done.
|
| + |
| +#include "base/strings/string16.h" |
| + |
| +namespace autofill { |
| + |
| +struct FormData; |
| +struct FormFieldData; |
| + |
| +using FormSignature = uint64_t; |
| +using FieldSignature = uint32_t; |
| + |
| +// Calculates form signature based on |form_data|. |
| +FormSignature CalculateFormSignature(const FormData& form_data); |
| + |
| +// Calculates field signature based on |field_name| and |field_type|. |
| +FieldSignature CalculateFieldSignatureByNameAndType( |
| + const base::string16& field_name, |
| + const std::string& field_type); |
| + |
| +// Calculates field signature based on |field_data|. This function is a proxy to |
| +// |CalculateFieldSignatureByNameAndType|. |
| +FieldSignature CalculateFieldSignatureForField(const FormFieldData& field_data); |
| + |
| +// Returns 64-bit hash of the string. |
| +uint64_t StrToHash64Bit(const std::string& str); |
|
vabr (Chromium)
2016/09/08 09:13:24
optional: While you are at it, you should #include
kolos1
2016/09/08 09:41:39
Done.
|
| + |
| +// Returns 32-bit hash of the string. |
| +uint32_t StrToHash32Bit(const std::string& str); |
| + |
| +} |
| + |
| +#endif // COMPONENTS_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_ |