OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_NET_LOG_H_ | 5 #ifndef NET_BASE_NET_LOG_H_ |
6 #define NET_BASE_NET_LOG_H_ | 6 #define NET_BASE_NET_LOG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 virtual int NextID() = 0; | 111 virtual int NextID() = 0; |
112 | 112 |
113 // Returns true if more complicated messages should be sent to the log. | 113 // Returns true if more complicated messages should be sent to the log. |
114 // TODO(eroman): This is a carry-over from refactoring; figure out | 114 // TODO(eroman): This is a carry-over from refactoring; figure out |
115 // something better. | 115 // something better. |
116 virtual bool HasListener() const = 0; | 116 virtual bool HasListener() const = 0; |
117 | 117 |
118 // Returns a C-String symbolic name for |event_type|. | 118 // Returns a C-String symbolic name for |event_type|. |
119 static const char* EventTypeToString(EventType event_type); | 119 static const char* EventTypeToString(EventType event_type); |
120 | 120 |
| 121 // Returns a list of all the available EventTypes. |
| 122 static std::vector<EventType> GetAllEventTypes(); |
| 123 |
121 private: | 124 private: |
122 DISALLOW_COPY_AND_ASSIGN(NetLog); | 125 DISALLOW_COPY_AND_ASSIGN(NetLog); |
123 }; | 126 }; |
124 | 127 |
125 // Helper that binds a Source to a NetLog, and exposes convenience methods to | 128 // Helper that binds a Source to a NetLog, and exposes convenience methods to |
126 // output log messages without needing to pass in the source. | 129 // output log messages without needing to pass in the source. |
127 class BoundNetLog { | 130 class BoundNetLog { |
128 public: | 131 public: |
129 BoundNetLog() : net_log_(NULL) {} | 132 BoundNetLog() : net_log_(NULL) {} |
130 | 133 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 private: | 232 private: |
230 NetLog::Source source_; | 233 NetLog::Source source_; |
231 scoped_ptr<CapturingNetLog> capturing_net_log_; | 234 scoped_ptr<CapturingNetLog> capturing_net_log_; |
232 | 235 |
233 DISALLOW_COPY_AND_ASSIGN(CapturingBoundNetLog); | 236 DISALLOW_COPY_AND_ASSIGN(CapturingBoundNetLog); |
234 }; | 237 }; |
235 | 238 |
236 } // namespace net | 239 } // namespace net |
237 | 240 |
238 #endif // NET_BASE_NET_LOG_H_ | 241 #endif // NET_BASE_NET_LOG_H_ |
OLD | NEW |