OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef NET_LOG_TEST_NET_LOG_H_ |
6 #define NET_LOG_TEST_NET_LOG_H_ | 6 #define NET_LOG_TEST_NET_LOG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // net_test_support project. | 21 // net_test_support project. |
22 class TestNetLog : public NetLog { | 22 class TestNetLog : public NetLog { |
23 public: | 23 public: |
24 // TODO(mmenke): Get rid of these. | 24 // TODO(mmenke): Get rid of these. |
25 typedef CapturedNetLogEntry CapturedEntry; | 25 typedef CapturedNetLogEntry CapturedEntry; |
26 typedef CapturedNetLogEntry::List CapturedEntryList; | 26 typedef CapturedNetLogEntry::List CapturedEntryList; |
27 | 27 |
28 TestNetLog(); | 28 TestNetLog(); |
29 ~TestNetLog() override; | 29 ~TestNetLog() override; |
30 | 30 |
31 void SetLogLevel(LogLevel log_level); | 31 void SetCaptureMode(NetLogCaptureMode capture_mode); |
32 | 32 |
33 // Below methods are forwarded to capturing_net_log_observer_. | 33 // Below methods are forwarded to capturing_net_log_observer_. |
34 void GetEntries(CapturedEntryList* entry_list) const; | 34 void GetEntries(CapturedEntryList* entry_list) const; |
35 void GetEntriesForSource(Source source, CapturedEntryList* entry_list) const; | 35 void GetEntriesForSource(Source source, CapturedEntryList* entry_list) const; |
36 size_t GetSize() const; | 36 size_t GetSize() const; |
37 void Clear(); | 37 void Clear(); |
38 | 38 |
39 private: | 39 private: |
40 CapturingNetLogObserver capturing_net_log_observer_; | 40 CapturingNetLogObserver capturing_net_log_observer_; |
41 | 41 |
(...skipping 18 matching lines...) Expand all Loading... |
60 | 60 |
61 // Fills |entry_list| with all entries in the log from the specified Source. | 61 // Fills |entry_list| with all entries in the log from the specified Source. |
62 void GetEntriesForSource(NetLog::Source source, | 62 void GetEntriesForSource(NetLog::Source source, |
63 TestNetLog::CapturedEntryList* entry_list) const; | 63 TestNetLog::CapturedEntryList* entry_list) const; |
64 | 64 |
65 // Returns number of entries in the log. | 65 // Returns number of entries in the log. |
66 size_t GetSize() const; | 66 size_t GetSize() const; |
67 | 67 |
68 void Clear(); | 68 void Clear(); |
69 | 69 |
70 // Sets the log level of the underlying TestNetLog. | 70 // Sets the capture mode of the underlying TestNetLog. |
71 void SetLogLevel(NetLog::LogLevel log_level); | 71 void SetCaptureMode(NetLogCaptureMode capture_mode); |
72 | 72 |
73 private: | 73 private: |
74 TestNetLog capturing_net_log_; | 74 TestNetLog capturing_net_log_; |
75 const BoundNetLog net_log_; | 75 const BoundNetLog net_log_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); | 77 DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace net | 80 } // namespace net |
81 | 81 |
82 #endif // NET_LOG_TEST_NET_LOG_H_ | 82 #endif // NET_LOG_TEST_NET_LOG_H_ |
OLD | NEW |