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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc

Issue 2845113002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chrome (Closed)
Patch Set: Address comments 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/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
index b3f927cec75ee52a82d8207fec8ace1ae11505c0..63b50d8b60174376730c2a40c58b496f839f0e59 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
@@ -22,6 +22,7 @@
#include "base/test/scoped_mock_time_message_loop_task_runner.h"
#include "base/threading/thread_local.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/safe_browsing/incident_reporting/incident.h"
@@ -1313,12 +1314,13 @@ TEST_F(IncidentReportingServiceTest, CleanLegacyPruneState) {
// Set up a prune state dict with data to be cleared (and not).
std::unique_ptr<base::DictionaryValue> incidents_sent(
new base::DictionaryValue());
- base::DictionaryValue* type_dict = new base::DictionaryValue();
+ auto type_dict = base::MakeUnique<base::DictionaryValue>();
type_dict->SetStringWithoutPathExpansion("foo", "47");
- incidents_sent->SetWithoutPathExpansion(omnibox_type, type_dict);
- type_dict = new base::DictionaryValue();
+ incidents_sent->SetWithoutPathExpansion(omnibox_type, std::move(type_dict));
+ type_dict = base::MakeUnique<base::DictionaryValue>();
type_dict->SetStringWithoutPathExpansion("bar", "43");
- incidents_sent->SetWithoutPathExpansion(preference_type, type_dict);
+ incidents_sent->SetWithoutPathExpansion(preference_type,
+ std::move(type_dict));
// Add a profile.
Profile* profile =
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698