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

Side by Side Diff: components/autofill/core/common/signatures_util.h

Issue 2318533002: [Password Generation] Use signatures for form matching (Closed)
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_
7
8 #include <stddef.h>
9
10 #include <stdint.h>
11 #include <string>
12
13 #include "base/strings/string16.h"
14
15 namespace autofill {
16
17 struct FormData;
18 struct FormFieldData;
19
20 using FormSignature = uint64_t;
21 using FieldSignature = uint32_t;
22
23 // Calculates form signature based on |form_data|.
24 FormSignature CalculateFormSignature(const FormData& form_data);
25
26 // Calculates field signature based on |field_name| and |field_type|.
27 FieldSignature CalculateFieldSignatureByNameAndType(
28 const base::string16& field_name,
29 const std::string& field_type);
30
31 // Calculates field signature based on |field_data|. This function is a proxy to
32 // |CalculateFieldSignatureByNameAndType|.
33 FieldSignature CalculateFieldSignatureForField(const FormFieldData& field_data);
34
35 // Returns 64-bit hash of the string.
36 uint64_t StrToHash64Bit(const std::string& str);
37
38 // Returns 32-bit hash of the string.
39 uint32_t StrToHash32Bit(const std::string& str);
40
41 }
42
43 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_
OLDNEW
« no previous file with comments | « components/autofill/core/common/password_form_generation_data.h ('k') | components/autofill/core/common/signatures_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698