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

Unified Diff: net/log/net_log_unittest.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 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
« no previous file with comments | « net/log/net_log.cc ('k') | net/log/net_log_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/net_log_unittest.cc
diff --git a/net/log/net_log_unittest.cc b/net/log/net_log_unittest.cc
index 1a16facf22f293bcb8763a67bf996f2d112b2121..95de6d0ba74a31ed9965cf59a34e6ea4040528ec 100644
--- a/net/log/net_log_unittest.cc
+++ b/net/log/net_log_unittest.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/simple_thread.h"
#include "base/values.h"
@@ -38,13 +39,15 @@ int CaptureModeToInt(NetLogCaptureMode capture_mode) {
return -1;
}
-scoped_ptr<base::Value> CaptureModeToValue(NetLogCaptureMode capture_mode) {
- return make_scoped_ptr(
+std::unique_ptr<base::Value> CaptureModeToValue(
+ NetLogCaptureMode capture_mode) {
+ return base::WrapUnique(
new base::FundamentalValue(CaptureModeToInt(capture_mode)));
}
-scoped_ptr<base::Value> NetCaptureModeCallback(NetLogCaptureMode capture_mode) {
- scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+std::unique_ptr<base::Value> NetCaptureModeCallback(
+ NetLogCaptureMode capture_mode) {
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->Set("capture_mode", CaptureModeToValue(capture_mode));
return std::move(dict);
}
@@ -130,8 +133,8 @@ class LoggingObserver : public NetLog::ThreadSafeObserver {
}
void OnAddEntry(const NetLog::Entry& entry) override {
- scoped_ptr<base::DictionaryValue> dict =
- base::DictionaryValue::From(make_scoped_ptr(entry.ToValue()));
+ std::unique_ptr<base::DictionaryValue> dict =
+ base::DictionaryValue::From(base::WrapUnique(entry.ToValue()));
ASSERT_TRUE(dict);
values_.push_back(std::move(dict));
}
@@ -142,7 +145,7 @@ class LoggingObserver : public NetLog::ThreadSafeObserver {
}
private:
- std::vector<scoped_ptr<base::DictionaryValue>> values_;
+ std::vector<std::unique_ptr<base::DictionaryValue>> values_;
};
void AddEvent(NetLog* net_log) {
« no previous file with comments | « net/log/net_log.cc ('k') | net/log/net_log_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698