OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_RENDERER_ARGUMENT_SPEC_H_ | 5 #ifndef EXTENSIONS_RENDERER_ARGUMENT_SPEC_H_ |
6 #define EXTENSIONS_RENDERER_ARGUMENT_SPEC_H_ | 6 #define EXTENSIONS_RENDERER_ARGUMENT_SPEC_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 std::string* error) const; | 114 std::string* error) const; |
115 | 115 |
116 // Returns an error message indicating the type of |value| does not match the | 116 // Returns an error message indicating the type of |value| does not match the |
117 // expected type. | 117 // expected type. |
118 std::string GetInvalidTypeError(v8::Local<v8::Value> value) const; | 118 std::string GetInvalidTypeError(v8::Local<v8::Value> value) const; |
119 | 119 |
120 // The name of the argument. | 120 // The name of the argument. |
121 std::string name_; | 121 std::string name_; |
122 | 122 |
123 // The type of the argument. | 123 // The type of the argument. |
124 ArgumentType type_; | 124 ArgumentType type_ = ArgumentType::INTEGER; |
125 | 125 |
126 // Whether or not the argument is required. | 126 // Whether or not the argument is required. |
127 bool optional_; | 127 bool optional_ = false; |
128 | 128 |
129 // Whether to preserve null properties found in objects. | 129 // Whether to preserve null properties found in objects. |
130 bool preserve_null_; | 130 bool preserve_null_ = false; |
131 | 131 |
132 // The reference the argument points to, if any. Note that if this is set, | 132 // The reference the argument points to, if any. Note that if this is set, |
133 // none of the following fields describing the argument will be. | 133 // none of the following fields describing the argument will be. |
134 base::Optional<std::string> ref_; | 134 base::Optional<std::string> ref_; |
135 | 135 |
136 // The type of instance an object should be, if any. Only applicable for | 136 // The type of instance an object should be, if any. Only applicable for |
137 // ArgumentType::OBJECT. If specified, the argument must contain the instance | 137 // ArgumentType::OBJECT. If specified, the argument must contain the instance |
138 // type in its prototype chain. | 138 // type in its prototype chain. |
139 base::Optional<std::string> instance_of_; | 139 base::Optional<std::string> instance_of_; |
140 | 140 |
(...skipping 25 matching lines...) Expand all Loading... |
166 // to allow the API to pass an object with arbitrary properties. Only | 166 // to allow the API to pass an object with arbitrary properties. Only |
167 // applicable for ArgumentType::OBJECT. | 167 // applicable for ArgumentType::OBJECT. |
168 std::unique_ptr<ArgumentSpec> additional_properties_; | 168 std::unique_ptr<ArgumentSpec> additional_properties_; |
169 | 169 |
170 DISALLOW_COPY_AND_ASSIGN(ArgumentSpec); | 170 DISALLOW_COPY_AND_ASSIGN(ArgumentSpec); |
171 }; | 171 }; |
172 | 172 |
173 } // namespace extensions | 173 } // namespace extensions |
174 | 174 |
175 #endif // EXTENSIONS_RENDERER_ARGUMENT_SPEC_H_ | 175 #endif // EXTENSIONS_RENDERER_ARGUMENT_SPEC_H_ |
OLD | NEW |