| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 private: | 130 private: |
| 131 DISALLOW_COPY_AND_ASSIGN(NetLog); | 131 DISALLOW_COPY_AND_ASSIGN(NetLog); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 // Helper that binds a Source to a NetLog, and exposes convenience methods to | 134 // Helper that binds a Source to a NetLog, and exposes convenience methods to |
| 135 // output log messages without needing to pass in the source. | 135 // output log messages without needing to pass in the source. |
| 136 class BoundNetLog { | 136 class BoundNetLog { |
| 137 public: | 137 public: |
| 138 BoundNetLog() : net_log_(NULL) {} | 138 BoundNetLog() : net_log_(NULL) {} |
| 139 | 139 |
| 140 // TODO(eroman): This is a complete hack to allow passing in NULL in | |
| 141 // place of a BoundNetLog. I added this while refactoring to simplify the | |
| 142 // task of updating all the callers. | |
| 143 BoundNetLog(uint32) : net_log_(NULL) {} | |
| 144 | |
| 145 BoundNetLog(const NetLog::Source& source, NetLog* net_log) | 140 BoundNetLog(const NetLog::Source& source, NetLog* net_log) |
| 146 : source_(source), net_log_(net_log) { | 141 : source_(source), net_log_(net_log) { |
| 147 } | 142 } |
| 148 | 143 |
| 149 // Convenience methods that call through to the NetLog, passing in the | 144 // Convenience methods that call through to the NetLog, passing in the |
| 150 // currently bound source. | 145 // currently bound source. |
| 151 void AddEntry(NetLog::EventType type, | 146 void AddEntry(NetLog::EventType type, |
| 152 NetLog::EventPhase phase, | 147 NetLog::EventPhase phase, |
| 153 const scoped_refptr<NetLog::EventParameters>& params) const; | 148 const scoped_refptr<NetLog::EventParameters>& params) const; |
| 154 | 149 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 virtual Value* ToValue() const; | 210 virtual Value* ToValue() const; |
| 216 | 211 |
| 217 private: | 212 private: |
| 218 const char* name_; | 213 const char* name_; |
| 219 const int value_; | 214 const int value_; |
| 220 }; | 215 }; |
| 221 | 216 |
| 222 } // namespace net | 217 } // namespace net |
| 223 | 218 |
| 224 #endif // NET_BASE_NET_LOG_H_ | 219 #endif // NET_BASE_NET_LOG_H_ |
| OLD | NEW |