| Index: chrome/browser/speech/extension_api/tts_extension_api.cc
|
| diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc
|
| index bfaf3526e746dc629b3dece13a40d7eeb56ab1e2..d8de59d92123386dd222f946f5869ac932db42a0 100644
|
| --- a/chrome/browser/speech/extension_api/tts_extension_api.cc
|
| +++ b/chrome/browser/speech/extension_api/tts_extension_api.cc
|
| @@ -319,7 +319,7 @@ ExtensionFunction::ResponseAction TtsGetVoicesFunction::Run() {
|
| std::vector<VoiceData> voices;
|
| TtsController::GetInstance()->GetVoices(browser_context(), &voices);
|
|
|
| - std::unique_ptr<base::ListValue> result_voices(new base::ListValue());
|
| + auto result_voices = base::MakeUnique<base::ListValue>();
|
| for (size_t i = 0; i < voices.size(); ++i) {
|
| const VoiceData& voice = voices[i];
|
| std::unique_ptr<base::DictionaryValue> result_voice(
|
| @@ -335,13 +335,13 @@ ExtensionFunction::ResponseAction TtsGetVoicesFunction::Run() {
|
| if (!voice.extension_id.empty())
|
| result_voice->SetString(constants::kExtensionIdKey, voice.extension_id);
|
|
|
| - base::ListValue* event_types = new base::ListValue();
|
| + auto event_types = base::MakeUnique<base::ListValue>();
|
| for (std::set<TtsEventType>::iterator iter = voice.events.begin();
|
| iter != voice.events.end(); ++iter) {
|
| const char* event_name_constant = TtsEventTypeToString(*iter);
|
| event_types->AppendString(event_name_constant);
|
| }
|
| - result_voice->Set(constants::kEventTypesKey, event_types);
|
| + result_voice->Set(constants::kEventTypesKey, std::move(event_types));
|
|
|
| result_voices->Append(std::move(result_voice));
|
| }
|
|
|