| Index: extensions/browser/api/runtime/runtime_api.cc
|
| diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc
|
| index e62805e674289632f33a1786b7a89eac8b06d478..08eed6ef157af9bf9a74ac3cbd0d81e9e60dd71c 100644
|
| --- a/extensions/browser/api/runtime/runtime_api.cc
|
| +++ b/extensions/browser/api/runtime/runtime_api.cc
|
| @@ -9,6 +9,7 @@
|
|
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/values.h"
|
| #include "base/version.h"
|
| @@ -531,12 +532,13 @@ ExtensionFunction::ResponseAction RuntimeRequestUpdateCheckFunction::Run() {
|
| void RuntimeRequestUpdateCheckFunction::CheckComplete(
|
| const RuntimeAPIDelegate::UpdateCheckResult& result) {
|
| if (result.success) {
|
| - base::DictionaryValue* details = new base::DictionaryValue;
|
| + std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue);
|
| details->SetString("version", result.version);
|
| - Respond(TwoArguments(new base::StringValue(result.response), details));
|
| + Respond(TwoArguments(base::MakeUnique<base::StringValue>(result.response),
|
| + std::move(details)));
|
| } else {
|
| // HMM(kalman): Why does !success not imply Error()?
|
| - Respond(OneArgument(new base::StringValue(result.response)));
|
| + Respond(OneArgument(base::MakeUnique<base::StringValue>(result.response)));
|
| }
|
| }
|
|
|
| @@ -577,10 +579,10 @@ RuntimeGetPackageDirectoryEntryFunction::Run() {
|
| content::ChildProcessSecurityPolicy* policy =
|
| content::ChildProcessSecurityPolicy::GetInstance();
|
| policy->GrantReadFileSystem(renderer_id, filesystem_id);
|
| - base::DictionaryValue* dict = new base::DictionaryValue();
|
| + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
| dict->SetString("fileSystemId", filesystem_id);
|
| dict->SetString("baseName", relative_path);
|
| - return RespondNow(OneArgument(dict));
|
| + return RespondNow(OneArgument(std::move(dict)));
|
| }
|
|
|
| } // namespace extensions
|
|
|