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

Unified Diff: net/log/net_log.cc

Issue 2891933004: Remove raw base::DictionaryValue::Set in //content (Closed)
Patch Set: Rebase Created 3 years, 7 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 | « net/log/net_log.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/net_log.cc
diff --git a/net/log/net_log.cc b/net/log/net_log.cc
index c482877b1ba49a756f14cb01f716d53437b38bdd..3ba872e986b0972905bdb9111f07486d1c636ab5 100644
--- a/net/log/net_log.cc
+++ b/net/log/net_log.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -199,12 +200,12 @@ const char* NetLog::EventTypeToString(NetLogEventType event) {
}
// static
-base::Value* NetLog::GetEventTypesAsValue() {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+std::unique_ptr<base::Value> NetLog::GetEventTypesAsValue() {
+ auto dict = base::MakeUnique<base::DictionaryValue>();
for (int i = 0; i < static_cast<int>(NetLogEventType::COUNT); ++i) {
dict->SetInteger(EventTypeToString(static_cast<NetLogEventType>(i)), i);
}
- return dict.release();
+ return std::move(dict);
}
// static
@@ -222,12 +223,12 @@ const char* NetLog::SourceTypeToString(NetLogSourceType source) {
}
// static
-base::Value* NetLog::GetSourceTypesAsValue() {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+std::unique_ptr<base::Value> NetLog::GetSourceTypesAsValue() {
+ auto dict = base::MakeUnique<base::DictionaryValue>();
for (int i = 0; i < static_cast<int>(NetLogSourceType::COUNT); ++i) {
dict->SetInteger(SourceTypeToString(static_cast<NetLogSourceType>(i)), i);
}
- return dict.release();
+ return std::move(dict);
}
// static
« no previous file with comments | « net/log/net_log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698