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

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

Issue 98753005: [Autofill] Sanitize all data that comes in over IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Loosen kMaxListSize a notch Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
(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_VALIDATION_H_
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_DATA_VALIDATION_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
22 // messages over IPC or trying to act on potentialy corrupted data within the
23 // browser process:
24
25 // The maximum string size supported by Autofill.
26 extern const size_t kMaxDataLength;
27
28 // The maximum list size supported by Autofill.
29 extern const size_t kMaxListSize;
30
31 // Functions to verify whether the objects passed to them satisfy basic sanity
32 // checks, including being capped to the maximums defined by the constants
33 // above.
34 bool IsValidString(const std::string& str);
35 bool IsValidString16(const base::string16& str);
36 bool IsValidGURL(const GURL& url);
37 bool IsValidFormFieldData(const FormFieldData& field);
38 bool IsValidFormData(const FormData& form);
39 bool IsValidPasswordFormFillData(const PasswordFormFillData& form);
40 bool IsValidString16Vector(const std::vector<base::string16>& v);
41 bool IsValidFormDataVector(const std::vector<FormData>& v);
42
43 } // namespace autofill
44
45 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_DATA_VALIDATION_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | components/autofill/core/common/autofill_data_validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698