OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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_AUTOFILL_DATA_SANITIZER_H_ | |
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_DATA_SANITIZER_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/strings/string16.h" | |
12 | |
13 class GURL; | |
14 | |
15 namespace autofill { | |
16 | |
17 struct FormData; | |
18 struct FormFieldData; | |
19 struct PasswordFormFillData; | |
20 | |
21 // Constants to enforce data size caps, so as to avoid sending overly large | |
palmer
2013/12/20 19:53:36
As used, I think these are more to immediately rej
Ilya Sherman
2013/12/20 23:54:52
Done.
| |
22 // messages over IPC: | |
23 | |
24 // The maximum string size supported by Autofill. | |
25 extern const size_t kMaxDataLength; | |
26 | |
27 // The maximum list size supported by Autofill. | |
28 extern const size_t kMaxListSize; | |
29 | |
30 // Functions to verify whether the objects passed to them satisfy basic sanity | |
31 // checks, including being capped to the maximums defined by the constants | |
32 // above. | |
33 bool IsSanitizedString(const std::string& str); | |
34 bool IsSanitizedString16(const base::string16& str); | |
35 bool IsSanitizedGURL(const GURL& url); | |
36 bool IsSanitizedFormFieldData(const FormFieldData& field); | |
37 bool IsSanitizedFormData(const FormData& form); | |
38 bool IsSanitizedPasswordFormFillData(const PasswordFormFillData& form); | |
39 bool IsSanitizedString16Vector(const std::vector<base::string16>& v); | |
40 bool IsSanitizedFormDataVector(const std::vector<FormData>& v); | |
41 | |
42 } // namespace autofill | |
43 | |
44 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_DATA_SANITIZER_H_ | |
OLD | NEW |