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

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

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error 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/state_store.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/state_store.cc b/chrome/browser/safe_browsing/incident_reporting/state_store.cc
index 52f1c15c919adf6d982fcadb6d14fbc5f397ccb7..f5684e1149ba0e9d6cd341c5580e18c2eee35a68 100644
--- a/chrome/browser/safe_browsing/incident_reporting/state_store.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/state_store.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
@@ -42,8 +43,9 @@ void StateStore::Transaction::MarkAsReported(IncidentType type,
base::DictionaryValue* type_dict = nullptr;
if (!incidents_sent->GetDictionaryWithoutPathExpansion(type_string,
&type_dict)) {
- type_dict = new base::DictionaryValue();
- incidents_sent->SetWithoutPathExpansion(type_string, type_dict);
+ incidents_sent->SetWithoutPathExpansion(
+ type_string, base::MakeUnique<base::DictionaryValue>());
+ incidents_sent->GetDictionaryWithoutPathExpansion(type_string, &type_dict);
}
type_dict->SetStringWithoutPathExpansion(key, base::UintToString(digest));
}

Powered by Google App Engine
This is Rietveld 408576698