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

Unified Diff: net/log/net_log_unittest.cc

Issue 1466653002: Remove ScopedVector from message_pump_perftest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | 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 0046b4699f916bb099b96a4e2cb5caa8ca76dff1..fd2a29253709c32c409780294a8b9955368329b3 100644
--- a/net/log/net_log_unittest.cc
+++ b/net/log/net_log_unittest.cc
@@ -5,7 +5,6 @@
#include "net/log/net_log.h"
#include "base/bind.h"
-#include "base/memory/scoped_vector.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/simple_thread.h"
#include "base/values.h"
@@ -128,17 +127,19 @@ class LoggingObserver : public NetLog::ThreadSafeObserver {
}
void OnAddEntry(const NetLog::Entry& entry) override {
- base::Value* value = entry.ToValue();
- base::DictionaryValue* dict = NULL;
- ASSERT_TRUE(value->GetAsDictionary(&dict));
- values_.push_back(dict);
+ scoped_ptr<base::DictionaryValue> dict =
+ base::DictionaryValue::From(make_scoped_ptr(entry.ToValue()));
+ ASSERT_TRUE(dict);
+ values_.push_back(std::move(dict));
}
size_t GetNumValues() const { return values_.size(); }
- base::DictionaryValue* GetValue(size_t index) const { return values_[index]; }
+ base::DictionaryValue* GetValue(size_t index) const {
+ return values_[index].get();
+ }
private:
- ScopedVector<base::DictionaryValue> values_;
+ std::vector<scoped_ptr<base::DictionaryValue>> values_;
};
void AddEvent(NetLog* net_log) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698