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

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

Issue 2318533002: [Password Generation] Use signatures for form matching (Closed)
Patch Set: Sent to review 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 <vector>
12
13 #include "base/strings/string16.h"
14 #include "components/autofill/core/common/form_data.h"
vabr (Chromium) 2016/09/07 16:18:06 This and the following #include seem like they cou
kolos1 2016/09/08 08:34:28 Done. Thanks.
15 #include "components/autofill/core/common/form_field_data.h"
16 #include "url/gurl.h"
17
18 namespace autofill {
19
20 typedef uint64_t FormSignature;
dcheng 2016/09/07 19:56:39 Prefer using FormSignature = uint64_t in new code.
kolos1 2016/09/08 08:34:28 Done.
21 typedef uint32_t FieldSignature;
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 // 64-bit hash of the string - used in FormSignature and unit-tests.
36 uint64_t StrToHash64Bit(const std::string& str);
vabr (Chromium) 2016/09/07 16:18:06 optional nit: You defined an alias for this type (
kolos1 2016/09/08 08:34:28 Precisely, we use it not only for form signatures,
37
38 // 32-bit hash of the string - used in FormSignature and unit-tests.
39 uint32_t StrToHash32Bit(const std::string& str);
40 }
vabr (Chromium) 2016/09/07 16:18:06 nit: Please add a blank line above the '}'.
kolos1 2016/09/08 08:34:28 Done.
41
42 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_SIGNATURES_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698