| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // NetLog is the destination for log messages generated by the network stack. | 23 // NetLog is the destination for log messages generated by the network stack. |
| 24 // Each log message has a "source" field which identifies the specific entity | 24 // Each log message has a "source" field which identifies the specific entity |
| 25 // that generated the message (for example, which net::URLRequest or which | 25 // that generated the message (for example, which net::URLRequest or which |
| 26 // SocketStream). | 26 // SocketStream). |
| 27 // | 27 // |
| 28 // To avoid needing to pass in the "source id" to the logging functions, NetLog | 28 // To avoid needing to pass in the "source id" to the logging functions, NetLog |
| 29 // is usually accessed through a BoundNetLog, which will always pass in a | 29 // is usually accessed through a BoundNetLog, which will always pass in a |
| 30 // specific source ID. | 30 // specific source ID. |
| 31 // | 31 // |
| 32 // Note that NetLog is NOT THREADSAFE. | |
| 33 // | |
| 34 // ******** The NetLog (and associated logging) is a work in progress ******** | 32 // ******** The NetLog (and associated logging) is a work in progress ******** |
| 35 // | 33 // |
| 36 // TODO(eroman): Remove the 'const' qualitifer from the BoundNetLog methods. | 34 // TODO(eroman): Remove the 'const' qualitifer from the BoundNetLog methods. |
| 37 // TODO(eroman): Make the DNS jobs emit into the NetLog. | |
| 38 // TODO(eroman): Start a new Source each time net::URLRequest redirects | 35 // TODO(eroman): Start a new Source each time net::URLRequest redirects |
| 39 // (simpler to reason about each as a separate entity). | 36 // (simpler to reason about each as a separate entity). |
| 40 | 37 |
| 41 class NetLog { | 38 class NetLog { |
| 42 public: | 39 public: |
| 43 enum EventType { | 40 enum EventType { |
| 44 #define EVENT_TYPE(label) TYPE_ ## label, | 41 #define EVENT_TYPE(label) TYPE_ ## label, |
| 45 #include "net/base/net_log_event_type_list.h" | 42 #include "net/base/net_log_event_type_list.h" |
| 46 #undef EVENT_TYPE | 43 #undef EVENT_TYPE |
| 47 }; | 44 }; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 virtual Value* ToValue() const; | 266 virtual Value* ToValue() const; |
| 270 | 267 |
| 271 private: | 268 private: |
| 272 const char* name_; | 269 const char* name_; |
| 273 const NetLog::Source value_; | 270 const NetLog::Source value_; |
| 274 }; | 271 }; |
| 275 | 272 |
| 276 } // namespace net | 273 } // namespace net |
| 277 | 274 |
| 278 #endif // NET_BASE_NET_LOG_H_ | 275 #endif // NET_BASE_NET_LOG_H_ |
| OLD | NEW |