Chromium Code Reviews| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/string16.h" | |
|
mmenke
2012/06/13 19:42:13
I don't believe typedefs can be forward declared.
| |
| 16 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class DictionaryValue; | 20 class DictionaryValue; |
| 20 class TimeTicks; | 21 class TimeTicks; |
| 21 class Value; | 22 class Value; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 | 26 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 // Warning: |name| must remain valid for the life of the callback. | 300 // Warning: |name| must remain valid for the life of the callback. |
| 300 static ParametersCallback IntegerCallback(const char* name, int value); | 301 static ParametersCallback IntegerCallback(const char* name, int value); |
| 301 | 302 |
| 302 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes | 303 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes |
| 303 // |value| as a pointer to avoid copying, and emphasize it must be valid for | 304 // |value| as a pointer to avoid copying, and emphasize it must be valid for |
| 304 // the life of the callback. |value| may not be NULL. | 305 // the life of the callback. |value| may not be NULL. |
| 305 // Warning: |name| and |value| must remain valid for the life of the callback. | 306 // Warning: |name| and |value| must remain valid for the life of the callback. |
| 306 static ParametersCallback StringCallback(const char* name, | 307 static ParametersCallback StringCallback(const char* name, |
| 307 const std::string* value); | 308 const std::string* value); |
| 308 | 309 |
| 310 // Same as above, but takes in a UTF16 string. | |
| 311 static ParametersCallback StringCallback(const char* name, | |
| 312 const string16* value); | |
| 313 | |
| 309 protected: | 314 protected: |
| 310 // Child classes should respond to the new entry here. This includes | 315 // Child classes should respond to the new entry here. This includes |
| 311 // creating the Entry object and alerting their observers. | 316 // creating the Entry object and alerting their observers. |
| 312 virtual void OnAddEntry(const Entry& entry) = 0; | 317 virtual void OnAddEntry(const Entry& entry) = 0; |
| 313 | 318 |
| 314 // Subclasses must call these in the corresponding functions to set an | 319 // Subclasses must call these in the corresponding functions to set an |
| 315 // observer's |net_log_| and |log_level_| values. | 320 // observer's |net_log_| and |log_level_| values. |
| 316 void OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level); | 321 void OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level); |
| 317 void OnSetObserverLogLevel(ThreadSafeObserver* observer, | 322 void OnSetObserverLogLevel(ThreadSafeObserver* observer, |
| 318 LogLevel log_level); | 323 LogLevel log_level); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 475 virtual ~NetLogSourceParameter() {} | 480 virtual ~NetLogSourceParameter() {} |
| 476 | 481 |
| 477 private: | 482 private: |
| 478 const char* name_; | 483 const char* name_; |
| 479 const NetLog::Source value_; | 484 const NetLog::Source value_; |
| 480 }; | 485 }; |
| 481 | 486 |
| 482 } // namespace net | 487 } // namespace net |
| 483 | 488 |
| 484 #endif // NET_BASE_NET_LOG_H_ | 489 #endif // NET_BASE_NET_LOG_H_ |
| OLD | NEW |