Chromium Code Reviews| Index: chrome/common/extensions/api/input_ime/input_components_handler.cc |
| diff --git a/chrome/common/extensions/api/input_ime/input_components_handler.cc b/chrome/common/extensions/api/input_ime/input_components_handler.cc |
| index 36da8bb044fb59d3bc21ac8bdd09bb7d9f356b81..ce99bceabb75f85ad9f460cb99dbe7fe1c28c97b 100644 |
| --- a/chrome/common/extensions/api/input_ime/input_components_handler.cc |
| +++ b/chrome/common/extensions/api/input_ime/input_components_handler.cc |
| @@ -117,21 +117,19 @@ bool InputComponentsHandler::Parse(Extension* extension, |
| // Get input_components[i].layouts. |
| const ListValue* layouts_value = NULL; |
| - if (!module_value->GetList(keys::kLayouts, &layouts_value)) { |
| - *error = ASCIIToUTF16( |
| - errors::kInvalidInputComponentLayouts); |
| - return false; |
| - } |
| - |
| - for (size_t j = 0; j < layouts_value->GetSize(); ++j) { |
| - std::string layout_name_str; |
| - if (!layouts_value->GetString(j, &layout_name_str)) { |
| - *error = ErrorUtils::FormatErrorMessageUTF16( |
| - errors::kInvalidInputComponentLayoutName, |
| - base::IntToString(i), base::IntToString(j)); |
| - return false; |
| + if (module_value->GetList(keys::kLayouts, &layouts_value)) { |
| + for (size_t j = 0; j < layouts_value->GetSize(); ++j) { |
| + std::string layout_name_str; |
| + if (!layouts_value->GetString(j, &layout_name_str)) { |
| + *error = ErrorUtils::FormatErrorMessageUTF16( |
| + errors::kInvalidInputComponentLayoutName, |
| + base::IntToString(i), base::IntToString(j)); |
| + return false; |
| + } |
| + layouts.insert(layout_name_str); |
| } |
| - layouts.insert(layout_name_str); |
| + } else { |
| + layouts_value = new ListValue(); |
|
Matt Perry
2013/05/10 16:54:10
layouts_value is never used. This will leak.
Seigo Nonaka
2013/05/10 18:04:00
Yes, nice catch!
On 2013/05/10 16:54:10, Matt Per
|
| } |
| if (module_value->HasKey(keys::kShortcutKey)) { |