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

Side by Side Diff: net/log/test_net_log_entry.h

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 unified diff | Download patch
« no previous file with comments | « net/log/test_net_log.cc ('k') | net/log/test_net_log_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_LOG_TEST_NET_LOG_ENTRY_H_ 5 #ifndef NET_LOG_TEST_NET_LOG_ENTRY_H_
6 #define NET_LOG_TEST_NET_LOG_ENTRY_H_ 6 #define NET_LOG_TEST_NET_LOG_ENTRY_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "net/log/net_log.h" 13 #include "net/log/net_log.h"
14 14
15 namespace base { 15 namespace base {
16 class DictionaryValue; 16 class DictionaryValue;
17 class ListValue; 17 class ListValue;
18 } 18 }
19 19
20 namespace net { 20 namespace net {
21 21
22 // TestNetLogEntry is much like NetLog::Entry, except it has its own copy of all 22 // TestNetLogEntry is much like NetLog::Entry, except it has its own copy of all
23 // log data, so a list of entries can be gathered over the course of a test, and 23 // log data, so a list of entries can be gathered over the course of a test, and
24 // then inspected at the end. It is intended for testing only, and is part of 24 // then inspected at the end. It is intended for testing only, and is part of
25 // the net_test_support project. 25 // the net_test_support project.
26 struct TestNetLogEntry { 26 struct TestNetLogEntry {
27 // Ordered set of logged entries. 27 // Ordered set of logged entries.
28 typedef std::vector<TestNetLogEntry> List; 28 typedef std::vector<TestNetLogEntry> List;
29 29
30 TestNetLogEntry(NetLog::EventType type, 30 TestNetLogEntry(NetLog::EventType type,
31 const base::TimeTicks& time, 31 const base::TimeTicks& time,
32 NetLog::Source source, 32 NetLog::Source source,
33 NetLog::EventPhase phase, 33 NetLog::EventPhase phase,
34 scoped_ptr<base::DictionaryValue> params); 34 std::unique_ptr<base::DictionaryValue> params);
35 // Copy constructor needed to store in a std::vector because of the 35 // Copy constructor needed to store in a std::vector because of the
36 // scoped_ptr. 36 // scoped_ptr.
37 TestNetLogEntry(const TestNetLogEntry& entry); 37 TestNetLogEntry(const TestNetLogEntry& entry);
38 38
39 ~TestNetLogEntry(); 39 ~TestNetLogEntry();
40 40
41 // Equality operator needed to store in a std::vector because of the 41 // Equality operator needed to store in a std::vector because of the
42 // scoped_ptr. 42 // scoped_ptr.
43 TestNetLogEntry& operator=(const TestNetLogEntry& entry); 43 TestNetLogEntry& operator=(const TestNetLogEntry& entry);
44 44
(...skipping 10 matching lines...) Expand all
55 bool GetNetErrorCode(int* value) const; 55 bool GetNetErrorCode(int* value) const;
56 56
57 // Returns the parameters as a JSON string, or empty string if there are no 57 // Returns the parameters as a JSON string, or empty string if there are no
58 // parameters. 58 // parameters.
59 std::string GetParamsJson() const; 59 std::string GetParamsJson() const;
60 60
61 NetLog::EventType type; 61 NetLog::EventType type;
62 base::TimeTicks time; 62 base::TimeTicks time;
63 NetLog::Source source; 63 NetLog::Source source;
64 NetLog::EventPhase phase; 64 NetLog::EventPhase phase;
65 scoped_ptr<base::DictionaryValue> params; 65 std::unique_ptr<base::DictionaryValue> params;
66 }; 66 };
67 67
68 } // namespace net 68 } // namespace net
69 69
70 #endif // NET_LOG_TEST_NET_LOG_ENTRY_H_ 70 #endif // NET_LOG_TEST_NET_LOG_ENTRY_H_
OLDNEW
« no previous file with comments | « net/log/test_net_log.cc ('k') | net/log/test_net_log_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698