summaryrefslogtreecommitdiff
path: root/chromium/net/log/test_net_log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/log/test_net_log.cc')
-rw-r--r--chromium/net/log/test_net_log.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/chromium/net/log/test_net_log.cc b/chromium/net/log/test_net_log.cc
index a1b383e8bce..c8d04cb71f1 100644
--- a/chromium/net/log/test_net_log.cc
+++ b/chromium/net/log/test_net_log.cc
@@ -4,6 +4,7 @@
#include "net/log/test_net_log.h"
+#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "base/values.h"
@@ -49,16 +50,14 @@ class TestNetLog::Observer : public NetLog::ThreadSafeObserver {
void OnAddEntry(const NetLog::Entry& entry) override {
// Using Dictionaries instead of Values makes checking values a little
// simpler.
- base::DictionaryValue* param_dict = nullptr;
- base::Value* param_value = entry.ParametersToValue();
- if (param_value && !param_value->GetAsDictionary(&param_dict))
- delete param_value;
+ scoped_ptr<base::DictionaryValue> param_dict =
+ base::DictionaryValue::From(entry.ParametersToValue());
// Only need to acquire the lock when accessing class variables.
base::AutoLock lock(lock_);
- entry_list_.push_back(TestNetLogEntry(
- entry.type(), base::TimeTicks::Now(), entry.source(), entry.phase(),
- scoped_ptr<base::DictionaryValue>(param_dict)));
+ entry_list_.push_back(TestNetLogEntry(entry.type(), base::TimeTicks::Now(),
+ entry.source(), entry.phase(),
+ std::move(param_dict)));
}
// Needs to be "mutable" to use it in GetEntries().