OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/log/test_net_log_entry.h" | 5 #include "net/log/test_net_log_entry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 TestNetLogEntry::TestNetLogEntry(NetLog::EventType type, | 15 TestNetLogEntry::TestNetLogEntry(NetLog::EventType type, |
16 const base::TimeTicks& time, | 16 const base::TimeTicks& time, |
17 NetLog::Source source, | 17 NetLog::Source source, |
18 NetLog::EventPhase phase, | 18 NetLog::EventPhase phase, |
19 scoped_ptr<base::DictionaryValue> params) | 19 std::unique_ptr<base::DictionaryValue> params) |
20 : type(type), | 20 : type(type), |
21 time(time), | 21 time(time), |
22 source(source), | 22 source(source), |
23 phase(phase), | 23 phase(phase), |
24 params(std::move(params)) { | 24 params(std::move(params)) { |
25 // Only entries without a NetLog should have an invalid source. | 25 // Only entries without a NetLog should have an invalid source. |
26 CHECK(source.IsValid()); | 26 CHECK(source.IsValid()); |
27 } | 27 } |
28 | 28 |
29 TestNetLogEntry::TestNetLogEntry(const TestNetLogEntry& entry) { | 29 TestNetLogEntry::TestNetLogEntry(const TestNetLogEntry& entry) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 std::string TestNetLogEntry::GetParamsJson() const { | 77 std::string TestNetLogEntry::GetParamsJson() const { |
78 if (!params) | 78 if (!params) |
79 return std::string(); | 79 return std::string(); |
80 std::string json; | 80 std::string json; |
81 base::JSONWriter::Write(*params, &json); | 81 base::JSONWriter::Write(*params, &json); |
82 return json; | 82 return json; |
83 } | 83 } |
84 | 84 |
85 } // namespace net | 85 } // namespace net |
OLD | NEW |