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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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
« no previous file with comments | « gpu/config/gpu_control_list.cc ('k') | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index 35fcea868776e453106e4ec7c5ae0eb37665a6fe..f7b705f16a7031733cf3d3b887f76e81583bf7bd 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -4,6 +4,8 @@
#include "net/http/http_server_properties_manager.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
@@ -1193,7 +1195,8 @@ void HttpServerPropertiesManager::SaveAlternativeServiceToServerPrefs(
const AlternativeService alternative_service =
alternative_service_info.alternative_service;
DCHECK(IsAlternateProtocolValid(alternative_service.protocol));
- base::DictionaryValue* alternative_service_dict = new base::DictionaryValue;
+ std::unique_ptr<base::DictionaryValue> alternative_service_dict(
+ new base::DictionaryValue);
alternative_service_dict->SetInteger(kPortKey, alternative_service.port);
if (!alternative_service.host.empty()) {
alternative_service_dict->SetString(kHostKey, alternative_service.host);
@@ -1205,7 +1208,7 @@ void HttpServerPropertiesManager::SaveAlternativeServiceToServerPrefs(
kExpirationKey,
base::Int64ToString(
alternative_service_info.expiration.ToInternalValue()));
- alternative_service_list->Append(alternative_service_dict);
+ alternative_service_list->Append(std::move(alternative_service_dict));
}
if (alternative_service_list->GetSize() == 0)
return;
« no previous file with comments | « gpu/config/gpu_control_list.cc ('k') | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698