| Index: chrome/browser/extensions/api/font_settings/font_settings_api.cc
|
| diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc
|
| index cce471f4a7a823de5a6f54e06a5a4f42b501baa0..376a1763d599cab51907d9c86e2653bc952a0e02 100644
|
| --- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc
|
| +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc
|
| @@ -8,6 +8,9 @@
|
|
|
| #include <stddef.h>
|
|
|
| +#include <memory>
|
| +#include <utility>
|
| +
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| #include "base/json/json_writer.h"
|
| @@ -270,10 +273,10 @@ bool FontSettingsGetFontFunction::RunSync() {
|
| extensions::preference_helpers::GetLevelOfControl(
|
| GetProfile(), extension_id(), pref_path, kIncognito);
|
|
|
| - base::DictionaryValue* result = new base::DictionaryValue();
|
| + std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
| result->SetString(kFontIdKey, font_name);
|
| result->SetString(kLevelOfControlKey, level_of_control);
|
| - SetResult(result);
|
| + SetResult(std::move(result));
|
| return true;
|
| }
|
|
|
| @@ -343,7 +346,7 @@ bool FontSettingsGetFontListFunction::CopyFontsToResult(
|
| result->Append(font_name);
|
| }
|
|
|
| - SetResult(result.release());
|
| + SetResult(std::move(result));
|
| return true;
|
| }
|
|
|
| @@ -371,10 +374,10 @@ bool GetFontPrefExtensionFunction::RunSync() {
|
| extensions::preference_helpers::GetLevelOfControl(
|
| GetProfile(), extension_id(), GetPrefName(), kIncognito);
|
|
|
| - base::DictionaryValue* result = new base::DictionaryValue();
|
| + std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
| result->Set(GetKey(), pref->GetValue()->DeepCopy());
|
| result->SetString(kLevelOfControlKey, level_of_control);
|
| - SetResult(result);
|
| + SetResult(std::move(result));
|
| return true;
|
| }
|
|
|
|
|