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

Unified Diff: chrome/browser/prefs/tracked/pref_hash_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/prefs/tracked/pref_hash_browsertest.cc
diff --git a/chrome/browser/prefs/tracked/pref_hash_browsertest.cc b/chrome/browser/prefs/tracked/pref_hash_browsertest.cc
index 513998b727f277aae996165a606ddf5b53dd2be5..ec49704052487b9cfd24af9c335cff4314fceb90 100644
--- a/chrome/browser/prefs/tracked/pref_hash_browsertest.cc
+++ b/chrome/browser/prefs/tracked/pref_hash_browsertest.cc
@@ -4,6 +4,7 @@
#include <memory>
#include <string>
+#include <utility>
#include "base/base_switches.h"
#include "base/command_line.h"
@@ -11,6 +12,7 @@
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
@@ -885,9 +887,9 @@ class PrefHashBrowserTestChangedSplitPref : public PrefHashBrowserTestBase {
// Drop a fake extension (for the purpose of this test, dropped settings
// don't need to be valid extension settings).
- base::DictionaryValue* fake_extension = new base::DictionaryValue;
+ auto fake_extension = base::MakeUnique<base::DictionaryValue>();
fake_extension->SetString("name", "foo");
- extensions_dict->Set(std::string(32, 'a'), fake_extension);
+ extensions_dict->Set(std::string(32, 'a'), std::move(fake_extension));
}
void VerifyReactionToPrefAttack() override {
« no previous file with comments | « chrome/browser/prefs/session_startup_pref_unittest.cc ('k') | chrome/common/extensions/sync_type_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698