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

Unified Diff: chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 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/sync/test/integration/two_client_bookmarks_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
index d08e930ad11307b6874e5ade5580df16dc86d07e..9b38f3e47e9b75c7acdcb0821f21be81e4e8a77e 100644
--- a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
@@ -4,6 +4,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/macros.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
@@ -2208,12 +2210,12 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, ManagedBookmarks) {
base::DictionaryValue* bookmark = new base::DictionaryValue();
bookmark->SetString("name", "Managed bookmark");
bookmark->SetString("url", "youtube.com");
- base::ListValue* list = new base::ListValue();
+ std::unique_ptr<base::ListValue> list(new base::ListValue());
list->Append(bookmark);
policy::PolicyMap policy;
- policy.Set(policy::key::kManagedBookmarks,
- policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD, list, nullptr);
+ policy.Set(policy::key::kManagedBookmarks, policy::POLICY_LEVEL_MANDATORY,
+ policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
+ std::move(list), nullptr);
policy_provider_.UpdateChromePolicy(policy);
base::RunLoop().RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698