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

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

Issue 1684793003: Add comments for struct members that were changed from size_t to uin32_t or uint64_t for IPC safety. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « chrome/common/spellcheck_marker.h ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 27 matching lines...) Expand all
38 // Comparison operator exposed for STL map. Uses label, then name to sort. 38 // Comparison operator exposed for STL map. Uses label, then name to sort.
39 bool operator<(const FormFieldData& field) const; 39 bool operator<(const FormFieldData& field) const;
40 40
41 // If you add more, be sure to update the comparison operator, SameFieldAs, 41 // If you add more, be sure to update the comparison operator, SameFieldAs,
42 // serializing functions (in the .cc file) and the constructor. 42 // serializing functions (in the .cc file) and the constructor.
43 base::string16 label; 43 base::string16 label;
44 base::string16 name; 44 base::string16 name;
45 base::string16 value; 45 base::string16 value;
46 std::string form_control_type; 46 std::string form_control_type;
47 std::string autocomplete_attribute; 47 std::string autocomplete_attribute;
48 // Note: we use uint32_t instead of size_t because this struct is sent over
49 // IPC which could span 32 & 64 bit processes. This is fine since the length
50 // shouldn't exceed UINT32_MAX even on 64 bit builds.
48 uint32_t max_length; 51 uint32_t max_length;
49 bool is_autofilled; 52 bool is_autofilled;
50 bool is_checked; 53 bool is_checked;
51 bool is_checkable; 54 bool is_checkable;
52 bool is_focusable; 55 bool is_focusable;
53 bool should_autocomplete; 56 bool should_autocomplete;
54 RoleAttribute role; 57 RoleAttribute role;
55 base::i18n::TextDirection text_direction; 58 base::i18n::TextDirection text_direction;
56 59
57 // For the HTML snippet |<option value="US">United States</option>|, the 60 // For the HTML snippet |<option value="US">United States</option>|, the
(...skipping 23 matching lines...) Expand all
81 EXPECT_EQ(expected.autocomplete_attribute, actual.autocomplete_attribute); \ 84 EXPECT_EQ(expected.autocomplete_attribute, actual.autocomplete_attribute); \
82 EXPECT_EQ(expected.max_length, actual.max_length); \ 85 EXPECT_EQ(expected.max_length, actual.max_length); \
83 EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \ 86 EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \
84 EXPECT_EQ(expected.is_checked, actual.is_checked); \ 87 EXPECT_EQ(expected.is_checked, actual.is_checked); \
85 EXPECT_EQ(expected.is_checkable, actual.is_checkable); \ 88 EXPECT_EQ(expected.is_checkable, actual.is_checkable); \
86 } while (0) 89 } while (0)
87 90
88 } // namespace autofill 91 } // namespace autofill
89 92
90 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ 93 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_
OLDNEW
« no previous file with comments | « chrome/common/spellcheck_marker.h ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698