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

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

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 years, 2 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
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 <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "net/log/net_log.h"
14 #include "net/log/net_log_event_type.h" 13 #include "net/log/net_log_event_type.h"
14 #include "net/log/net_log_source.h"
15 15
16 namespace base { 16 namespace base {
17 class DictionaryValue; 17 class DictionaryValue;
18 class ListValue; 18 class ListValue;
19 } 19 }
20 20
21 namespace net { 21 namespace net {
22 22
23 // TestNetLogEntry is much like NetLog::Entry, except it has its own copy of all 23 // TestNetLogEntry is much like NetLogEntry, except it has its own copy of all
24 // log data, so a list of entries can be gathered over the course of a test, and 24 // log data, so a list of entries can be gathered over the course of a test, and
25 // then inspected at the end. It is intended for testing only, and is part of 25 // then inspected at the end. It is intended for testing only, and is part of
26 // the net_test_support project. 26 // the net_test_support project.
27 struct TestNetLogEntry { 27 struct TestNetLogEntry {
28 // Ordered set of logged entries. 28 // Ordered set of logged entries.
29 typedef std::vector<TestNetLogEntry> List; 29 typedef std::vector<TestNetLogEntry> List;
30 30
31 TestNetLogEntry(NetLogEventType type, 31 TestNetLogEntry(NetLogEventType type,
32 const base::TimeTicks& time, 32 const base::TimeTicks& time,
33 NetLog::Source source, 33 NetLogSource source,
34 NetLogEventPhase phase, 34 NetLogEventPhase phase,
35 std::unique_ptr<base::DictionaryValue> params); 35 std::unique_ptr<base::DictionaryValue> params);
36 // Copy constructor needed to store in a std::vector because of the 36 // Copy constructor needed to store in a std::vector because of the
37 // scoped_ptr. 37 // scoped_ptr.
38 TestNetLogEntry(const TestNetLogEntry& entry); 38 TestNetLogEntry(const TestNetLogEntry& entry);
39 39
40 ~TestNetLogEntry(); 40 ~TestNetLogEntry();
41 41
42 // Equality operator needed to store in a std::vector because of the 42 // Equality operator needed to store in a std::vector because of the
43 // scoped_ptr. 43 // scoped_ptr.
(...skipping 10 matching lines...) Expand all
54 // Same as GetIntegerValue, but returns the error code associated with a 54 // Same as GetIntegerValue, but returns the error code associated with a
55 // log entry. 55 // log entry.
56 bool GetNetErrorCode(int* value) const; 56 bool GetNetErrorCode(int* value) const;
57 57
58 // Returns the parameters as a JSON string, or empty string if there are no 58 // Returns the parameters as a JSON string, or empty string if there are no
59 // parameters. 59 // parameters.
60 std::string GetParamsJson() const; 60 std::string GetParamsJson() const;
61 61
62 NetLogEventType type; 62 NetLogEventType type;
63 base::TimeTicks time; 63 base::TimeTicks time;
64 NetLog::Source source; 64 NetLogSource source;
65 NetLogEventPhase phase; 65 NetLogEventPhase phase;
66 std::unique_ptr<base::DictionaryValue> params; 66 std::unique_ptr<base::DictionaryValue> params;
67 }; 67 };
68 68
69 } // namespace net 69 } // namespace net
70 70
71 #endif // NET_LOG_TEST_NET_LOG_ENTRY_H_ 71 #endif // NET_LOG_TEST_NET_LOG_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698