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

Unified Diff: chrome/browser/policy/policy_prefs_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/policy/policy_prefs_browsertest.cc
diff --git a/chrome/browser/policy/policy_prefs_browsertest.cc b/chrome/browser/policy/policy_prefs_browsertest.cc
index 15221e894f1109bc35893269e94b8d11bf49e17f..e207040943d6e4b0301c6d83740b342ee40fce69 100644
--- a/chrome/browser/policy/policy_prefs_browsertest.cc
+++ b/chrome/browser/policy/policy_prefs_browsertest.cc
@@ -17,6 +17,7 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
@@ -521,15 +522,11 @@ class PolicyPrefsTest : public InProcessBrowserTest {
const PolicyDetails* policy_details = GetChromePolicyDetails(it.key());
ASSERT_TRUE(policy_details);
policy_map.Set(
- it.key(),
- level,
- POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- it.value().DeepCopy(),
- policy_details->max_external_data_size ?
- new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(),
- it.key()) :
- NULL);
+ it.key(), level, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
+ it.value().CreateDeepCopy(),
+ base::WrapUnique(policy_details->max_external_data_size
+ ? new ExternalDataFetcher(nullptr, it.key())
+ : nullptr));
}
provider_.UpdateChromePolicy(policy_map);
base::RunLoop().RunUntilIdle();
« no previous file with comments | « chrome/browser/policy/policy_network_browsertest.cc ('k') | chrome/browser/policy/policy_startup_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698