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 #include "net/base/net_log.h" | 5 #include "net/base/net_log.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 Value* NetLogIntegerCallback(const char* name, | 50 Value* NetLogIntegerCallback(const char* name, |
51 int value, | 51 int value, |
52 NetLog::LogLevel /* log_level */) { | 52 NetLog::LogLevel /* log_level */) { |
53 DictionaryValue* event_params = new DictionaryValue(); | 53 DictionaryValue* event_params = new DictionaryValue(); |
54 event_params->SetInteger(name, value); | 54 event_params->SetInteger(name, value); |
55 return event_params; | 55 return event_params; |
56 } | 56 } |
57 | 57 |
| 58 Value* NetLogInt64Callback(const char* name, |
| 59 int64 value, |
| 60 NetLog::LogLevel /* log_level */) { |
| 61 DictionaryValue* event_params = new DictionaryValue(); |
| 62 event_params->SetString(name, base::Int64ToString(value)); |
| 63 return event_params; |
| 64 } |
| 65 |
58 Value* NetLogStringCallback(const char* name, | 66 Value* NetLogStringCallback(const char* name, |
59 const std::string* value, | 67 const std::string* value, |
60 NetLog::LogLevel /* log_level */) { | 68 NetLog::LogLevel /* log_level */) { |
61 DictionaryValue* event_params = new DictionaryValue(); | 69 DictionaryValue* event_params = new DictionaryValue(); |
62 event_params->SetString(name, *value); | 70 event_params->SetString(name, *value); |
63 return event_params; | 71 return event_params; |
64 } | 72 } |
65 | 73 |
66 Value* NetLogString16Callback(const char* name, | 74 Value* NetLogString16Callback(const char* name, |
67 const string16* value, | 75 const string16* value, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return log_level <= NetLog::LOG_ALL_BUT_BYTES; | 284 return log_level <= NetLog::LOG_ALL_BUT_BYTES; |
277 } | 285 } |
278 | 286 |
279 // static | 287 // static |
280 NetLog::ParametersCallback NetLog::IntegerCallback(const char* name, | 288 NetLog::ParametersCallback NetLog::IntegerCallback(const char* name, |
281 int value) { | 289 int value) { |
282 return base::Bind(&NetLogIntegerCallback, name, value); | 290 return base::Bind(&NetLogIntegerCallback, name, value); |
283 } | 291 } |
284 | 292 |
285 // static | 293 // static |
| 294 NetLog::ParametersCallback NetLog::Int64Callback(const char* name, |
| 295 int64 value) { |
| 296 return base::Bind(&NetLogInt64Callback, name, value); |
| 297 } |
| 298 |
| 299 // static |
286 NetLog::ParametersCallback NetLog::StringCallback(const char* name, | 300 NetLog::ParametersCallback NetLog::StringCallback(const char* name, |
287 const std::string* value) { | 301 const std::string* value) { |
288 DCHECK(value); | 302 DCHECK(value); |
289 return base::Bind(&NetLogStringCallback, name, value); | 303 return base::Bind(&NetLogStringCallback, name, value); |
290 } | 304 } |
291 | 305 |
292 // static | 306 // static |
293 NetLog::ParametersCallback NetLog::StringCallback(const char* name, | 307 NetLog::ParametersCallback NetLog::StringCallback(const char* name, |
294 const string16* value) { | 308 const string16* value) { |
295 DCHECK(value); | 309 DCHECK(value); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 } | 478 } |
465 | 479 |
466 Value* NetLogSourceParameter::ToValue() const { | 480 Value* NetLogSourceParameter::ToValue() const { |
467 DictionaryValue* dict = new DictionaryValue(); | 481 DictionaryValue* dict = new DictionaryValue(); |
468 if (value_.is_valid()) | 482 if (value_.is_valid()) |
469 dict->Set(name_, value_.ToValue()); | 483 dict->Set(name_, value_.ToValue()); |
470 return dict; | 484 return dict; |
471 } | 485 } |
472 | 486 |
473 } // namespace net | 487 } // namespace net |
OLD | NEW |