| 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/log/net_log.h" | 5 #include "net/log/net_log.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/alias.h" | 8 #include "base/debug/alias.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 base::Value* SourceEventParametersCallback( | 34 base::Value* SourceEventParametersCallback( |
| 35 const NetLog::Source source, | 35 const NetLog::Source source, |
| 36 NetLogCaptureMode /* capture_mode */) { | 36 NetLogCaptureMode /* capture_mode */) { |
| 37 if (!source.IsValid()) | 37 if (!source.IsValid()) |
| 38 return NULL; | 38 return NULL; |
| 39 base::DictionaryValue* event_params = new base::DictionaryValue(); | 39 base::DictionaryValue* event_params = new base::DictionaryValue(); |
| 40 source.AddToEventParameters(event_params); | 40 source.AddToEventParameters(event_params); |
| 41 return event_params; | 41 return event_params; |
| 42 } | 42 } |
| 43 | 43 |
| 44 base::Value* NetLogBoolCallback(const char* name, |
| 45 bool value, |
| 46 NetLogCaptureMode /* capture_mode */) { |
| 47 base::DictionaryValue* event_params = new base::DictionaryValue(); |
| 48 event_params->SetBoolean(name, value); |
| 49 return event_params; |
| 50 } |
| 51 |
| 44 base::Value* NetLogIntegerCallback(const char* name, | 52 base::Value* NetLogIntegerCallback(const char* name, |
| 45 int value, | 53 int value, |
| 46 NetLogCaptureMode /* capture_mode */) { | 54 NetLogCaptureMode /* capture_mode */) { |
| 47 base::DictionaryValue* event_params = new base::DictionaryValue(); | 55 base::DictionaryValue* event_params = new base::DictionaryValue(); |
| 48 event_params->SetInteger(name, value); | 56 event_params->SetInteger(name, value); |
| 49 return event_params; | 57 return event_params; |
| 50 } | 58 } |
| 51 | 59 |
| 52 base::Value* NetLogInt64Callback(const char* name, | 60 base::Value* NetLogInt64Callback(const char* name, |
| 53 int64 value, | 61 int64 value, |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 case PHASE_END: | 349 case PHASE_END: |
| 342 return "PHASE_END"; | 350 return "PHASE_END"; |
| 343 case PHASE_NONE: | 351 case PHASE_NONE: |
| 344 return "PHASE_NONE"; | 352 return "PHASE_NONE"; |
| 345 } | 353 } |
| 346 NOTREACHED(); | 354 NOTREACHED(); |
| 347 return NULL; | 355 return NULL; |
| 348 } | 356 } |
| 349 | 357 |
| 350 // static | 358 // static |
| 359 NetLog::ParametersCallback NetLog::BoolCallback(const char* name, bool value) { |
| 360 return base::Bind(&NetLogBoolCallback, name, value); |
| 361 } |
| 362 |
| 363 // static |
| 351 NetLog::ParametersCallback NetLog::IntegerCallback(const char* name, | 364 NetLog::ParametersCallback NetLog::IntegerCallback(const char* name, |
| 352 int value) { | 365 int value) { |
| 353 return base::Bind(&NetLogIntegerCallback, name, value); | 366 return base::Bind(&NetLogIntegerCallback, name, value); |
| 354 } | 367 } |
| 355 | 368 |
| 356 // static | 369 // static |
| 357 NetLog::ParametersCallback NetLog::Int64Callback(const char* name, | 370 NetLog::ParametersCallback NetLog::Int64Callback(const char* name, |
| 358 int64 value) { | 371 int64 value) { |
| 359 return base::Bind(&NetLogInt64Callback, name, value); | 372 return base::Bind(&NetLogInt64Callback, name, value); |
| 360 } | 373 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 Liveness liveness = liveness_; | 501 Liveness liveness = liveness_; |
| 489 | 502 |
| 490 if (liveness == ALIVE) | 503 if (liveness == ALIVE) |
| 491 return; | 504 return; |
| 492 | 505 |
| 493 base::debug::Alias(&liveness); | 506 base::debug::Alias(&liveness); |
| 494 CHECK_EQ(ALIVE, liveness); | 507 CHECK_EQ(ALIVE, liveness); |
| 495 } | 508 } |
| 496 | 509 |
| 497 } // namespace net | 510 } // namespace net |
| OLD | NEW |