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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/platform_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/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..813b5374519f4036721608a76512629229355dbe 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,9 @@ 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);
+ value_dict->SetWithoutPathExpansion(
+ type_string, base::MakeUnique<base::DictionaryValue>());
+ value_dict->GetDictionaryWithoutPathExpansion(type_string, &type_dict);
}
RestoreOfTypeFromProtobuf(type_incidents.incidents().key_to_digest(),
type_dict);

Powered by Google App Engine
This is Rietveld 408576698