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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/platform_state_store.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/platform_state_store.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc b/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc
index 8da6f1930fb8eb3b08cadf222148041b1f68de08..7cd2587518fca0ed0536b071fbe0600e2f56bd36 100644
--- a/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/safe_browsing/incident_reporting/platform_state_store.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#if defined(USE_PLATFORM_STATE_STORE)
@@ -115,8 +116,8 @@ void RestoreFromProtobuf(
base::DictionaryValue* type_dict = nullptr;
if (!value_dict->GetDictionaryWithoutPathExpansion(type_string,
&type_dict)) {
- type_dict = new base::DictionaryValue();
- value_dict->SetWithoutPathExpansion(type_string, type_dict);
+ type_dict = value_dict->SetDictionaryWithoutPathExpansion(
+ type_string, base::MakeUnique<base::DictionaryValue>());
}
RestoreOfTypeFromProtobuf(type_incidents.incidents().key_to_digest(),
type_dict);

Powered by Google App Engine
This is Rietveld 408576698