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

Unified Diff: chrome/browser/ui/webui/options/preferences_browsertest.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/ui/webui/options/preferences_browsertest.cc
diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.cc b/chrome/browser/ui/webui/options/preferences_browsertest.cc
index edfdb0ab43653db19cf76ea6104b4272d5fff2be..5a76e3d13f58a6b71aae6b30a9e7b92df6af40e3 100644
--- a/chrome/browser/ui/webui/options/preferences_browsertest.cc
+++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc
@@ -13,6 +13,7 @@
#include "base/callback.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -204,7 +205,7 @@ void PreferencesBrowserTest::SetUserPolicies(
policy::PolicyMap map;
for (size_t i = 0; i < names.size(); ++i) {
map.Set(names[i], level, policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD, values[i]->DeepCopy(), nullptr);
+ policy::POLICY_SOURCE_CLOUD, values[i]->CreateDeepCopy(), nullptr);
}
policy_provider_.UpdateChromePolicy(map);
}
@@ -880,12 +881,9 @@ class ProxyPreferencesBrowserTest : public PreferencesBrowserTest {
"}";
policy::PolicyMap map;
- map.Set(policy_name,
- policy::POLICY_LEVEL_MANDATORY,
- scope,
+ map.Set(policy_name, policy::POLICY_LEVEL_MANDATORY, scope,
policy::POLICY_SOURCE_CLOUD,
- new base::StringValue(onc_policy),
- NULL);
+ base::WrapUnique(new base::StringValue(onc_policy)), nullptr);
policy_provider_.UpdateChromePolicy(map);
content::RunAllPendingInMessageLoop();
« no previous file with comments | « chrome/browser/ui/webui/options/certificate_manager_browsertest.cc ('k') | chrome/browser/ui/webui/policy_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698