| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 class NET_EXPORT NetLogStringParameter : public NetLog::EventParameters { | 287 class NET_EXPORT NetLogStringParameter : public NetLog::EventParameters { |
| 288 public: | 288 public: |
| 289 // |name| must be a string literal. | 289 // |name| must be a string literal. |
| 290 NetLogStringParameter(const char* name, const std::string& value); | 290 NetLogStringParameter(const char* name, const std::string& value); |
| 291 virtual ~NetLogStringParameter(); | 291 virtual ~NetLogStringParameter(); |
| 292 | 292 |
| 293 const std::string& value() const { | 293 const std::string& value() const { |
| 294 return value_; | 294 return value_; |
| 295 } | 295 } |
| 296 | 296 |
| 297 virtual base::Value* ToValue() const; | 297 virtual base::Value* ToValue() const OVERRIDE; |
| 298 | 298 |
| 299 private: | 299 private: |
| 300 const char* const name_; | 300 const char* const name_; |
| 301 const std::string value_; | 301 const std::string value_; |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 // NetLogIntegerParameter is a subclass of EventParameters that encapsulates a | 304 // NetLogIntegerParameter is a subclass of EventParameters that encapsulates a |
| 305 // single integer parameter. | 305 // single integer parameter. |
| 306 class NetLogIntegerParameter : public NetLog::EventParameters { | 306 class NetLogIntegerParameter : public NetLog::EventParameters { |
| 307 public: | 307 public: |
| 308 // |name| must be a string literal. | 308 // |name| must be a string literal. |
| 309 NetLogIntegerParameter(const char* name, int value) | 309 NetLogIntegerParameter(const char* name, int value) |
| 310 : name_(name), value_(value) {} | 310 : name_(name), value_(value) {} |
| 311 | 311 |
| 312 int value() const { | 312 int value() const { |
| 313 return value_; | 313 return value_; |
| 314 } | 314 } |
| 315 | 315 |
| 316 virtual base::Value* ToValue() const; | 316 virtual base::Value* ToValue() const OVERRIDE; |
| 317 | 317 |
| 318 private: | 318 private: |
| 319 const char* name_; | 319 const char* name_; |
| 320 const int value_; | 320 const int value_; |
| 321 }; | 321 }; |
| 322 | 322 |
| 323 // NetLogSourceParameter is a subclass of EventParameters that encapsulates a | 323 // NetLogSourceParameter is a subclass of EventParameters that encapsulates a |
| 324 // single NetLog::Source parameter. | 324 // single NetLog::Source parameter. |
| 325 class NET_EXPORT NetLogSourceParameter : public NetLog::EventParameters { | 325 class NET_EXPORT NetLogSourceParameter : public NetLog::EventParameters { |
| 326 public: | 326 public: |
| 327 // |name| must be a string literal. | 327 // |name| must be a string literal. |
| 328 NetLogSourceParameter(const char* name, const NetLog::Source& value) | 328 NetLogSourceParameter(const char* name, const NetLog::Source& value) |
| 329 : name_(name), value_(value) {} | 329 : name_(name), value_(value) {} |
| 330 | 330 |
| 331 const NetLog::Source& value() const { | 331 const NetLog::Source& value() const { |
| 332 return value_; | 332 return value_; |
| 333 } | 333 } |
| 334 | 334 |
| 335 virtual base::Value* ToValue() const; | 335 virtual base::Value* ToValue() const OVERRIDE; |
| 336 | 336 |
| 337 private: | 337 private: |
| 338 const char* name_; | 338 const char* name_; |
| 339 const NetLog::Source value_; | 339 const NetLog::Source value_; |
| 340 }; | 340 }; |
| 341 | 341 |
| 342 // ScopedNetLogEvent logs a begin event on creation, and the corresponding end | 342 // ScopedNetLogEvent logs a begin event on creation, and the corresponding end |
| 343 // event on destruction. | 343 // event on destruction. |
| 344 class NET_EXPORT_PRIVATE ScopedNetLogEvent { | 344 class NET_EXPORT_PRIVATE ScopedNetLogEvent { |
| 345 public: | 345 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 359 | 359 |
| 360 private: | 360 private: |
| 361 BoundNetLog net_log_; | 361 BoundNetLog net_log_; |
| 362 const NetLog::EventType event_type_; | 362 const NetLog::EventType event_type_; |
| 363 scoped_refptr<NetLog::EventParameters> end_event_params_; | 363 scoped_refptr<NetLog::EventParameters> end_event_params_; |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 } // namespace net | 366 } // namespace net |
| 367 | 367 |
| 368 #endif // NET_BASE_NET_LOG_H_ | 368 #endif // NET_BASE_NET_LOG_H_ |
| OLD | NEW |