Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3232)

Unified Diff: chrome/browser/extensions/api/commands/command_service_browsertest.cc

Issue 2811673002: Reland: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Workaround with std::move Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/commands/command_service_browsertest.cc
diff --git a/chrome/browser/extensions/api/commands/command_service_browsertest.cc b/chrome/browser/extensions/api/commands/command_service_browsertest.cc
index 0f69acbf453a681720e877646877a021884aa115..636cffe6ef499552a9df64de22f56817b21fdd32 100644
--- a/chrome/browser/extensions/api/commands/command_service_browsertest.cc
+++ b/chrome/browser/extensions/api/commands/command_service_browsertest.cc
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
+#include "base/memory/ptr_util.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/commands/command_service.h"
#include "chrome/browser/extensions/extension_apitest.h"
@@ -110,11 +114,11 @@ IN_PROC_BROWSER_TEST_F(CommandServiceTest,
// another platform.
std::string anotherPlatformKey = GetAnotherCommandPlatform() + ":Alt+G";
const char kNamedCommandName[] = "toggle-feature";
- base::DictionaryValue* keybinding = new base::DictionaryValue();
+ auto keybinding = base::MakeUnique<base::DictionaryValue>();
keybinding->SetString("extension", extension->id());
keybinding->SetString("command_name", kNamedCommandName);
keybinding->SetBoolean("global", false);
- bindings->Set(anotherPlatformKey, keybinding);
+ bindings->Set(anotherPlatformKey, std::move(keybinding));
CommandService* command_service = CommandService::Get(browser()->profile());
command_service->RemoveKeybindingPrefs(extension->id(), kNamedCommandName);
« no previous file with comments | « chrome/browser/extensions/api/commands/command_service.cc ('k') | chrome/browser/extensions/api/cookies/cookies_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698