| 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_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 | 10 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // be logged. This is only the case when |log_level| is LOG_ALL. | 291 // be logged. This is only the case when |log_level| is LOG_ALL. |
| 292 static bool IsLoggingBytes(LogLevel log_level); | 292 static bool IsLoggingBytes(LogLevel log_level); |
| 293 | 293 |
| 294 // Returns true if |log_level| indicates that all events should be logged, | 294 // Returns true if |log_level| indicates that all events should be logged, |
| 295 // including frequently occuring ones that may impact performances. | 295 // including frequently occuring ones that may impact performances. |
| 296 // This is the case when |log_level| is LOG_ALL or LOG_ALL_BUT_BYTES. | 296 // This is the case when |log_level| is LOG_ALL or LOG_ALL_BUT_BYTES. |
| 297 static bool IsLoggingAllEvents(LogLevel log_level); | 297 static bool IsLoggingAllEvents(LogLevel log_level); |
| 298 | 298 |
| 299 // Creates a ParametersCallback that encapsulates a single integer. | 299 // Creates a ParametersCallback that encapsulates a single integer. |
| 300 // Warning: |name| must remain valid for the life of the callback. | 300 // Warning: |name| must remain valid for the life of the callback. |
| 301 // TODO(mmenke): Rename this to be consistent with Int64Callback. |
| 301 static ParametersCallback IntegerCallback(const char* name, int value); | 302 static ParametersCallback IntegerCallback(const char* name, int value); |
| 302 | 303 |
| 304 // Creates a ParametersCallback that encapsulates a single int64. The |
| 305 // callback will return the value as a StringValue, since IntegerValues |
| 306 // only support 32-bit values. |
| 307 // Warning: |name| must remain valid for the life of the callback. |
| 308 static ParametersCallback Int64Callback(const char* name, int64 value); |
| 309 |
| 303 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes | 310 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes |
| 304 // |value| as a pointer to avoid copying, and emphasize it must be valid for | 311 // |value| as a pointer to avoid copying, and emphasize it must be valid for |
| 305 // the life of the callback. |value| may not be NULL. | 312 // the life of the callback. |value| may not be NULL. |
| 306 // Warning: |name| and |value| must remain valid for the life of the callback. | 313 // Warning: |name| and |value| must remain valid for the life of the callback. |
| 307 static ParametersCallback StringCallback(const char* name, | 314 static ParametersCallback StringCallback(const char* name, |
| 308 const std::string* value); | 315 const std::string* value); |
| 309 | 316 |
| 310 // Same as above, but takes in a UTF16 string. | 317 // Same as above, but takes in a UTF16 string. |
| 311 static ParametersCallback StringCallback(const char* name, | 318 static ParametersCallback StringCallback(const char* name, |
| 312 const string16* value); | 319 const string16* value); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 virtual ~NetLogSourceParameter() {} | 487 virtual ~NetLogSourceParameter() {} |
| 481 | 488 |
| 482 private: | 489 private: |
| 483 const char* name_; | 490 const char* name_; |
| 484 const NetLog::Source value_; | 491 const NetLog::Source value_; |
| 485 }; | 492 }; |
| 486 | 493 |
| 487 } // namespace net | 494 } // namespace net |
| 488 | 495 |
| 489 #endif // NET_BASE_NET_LOG_H_ | 496 #endif // NET_BASE_NET_LOG_H_ |
| OLD | NEW |