| 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 #include "chrome/common/metrics_helpers.h" | 5 #include "chrome/common/metrics_helpers.h" |
| 6 | 6 |
| 7 #if defined(USE_SYSTEM_LIBBZ2) | 7 #if defined(USE_SYSTEM_LIBBZ2) |
| 8 #include <bzlib.h> | 8 #include <bzlib.h> |
| 9 #else | 9 #else |
| 10 #include "third_party/bzip2/bzlib.h" | 10 #include "third_party/bzip2/bzlib.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 int result = xmlTextWriterEndElement(xml_wrapper_->writer()); | 365 int result = xmlTextWriterEndElement(xml_wrapper_->writer()); |
| 366 DCHECK_GE(result, 0); | 366 DCHECK_GE(result, 0); |
| 367 } | 367 } |
| 368 | 368 |
| 369 // static | 369 // static |
| 370 int64 MetricsLogBase::GetBuildTime() { | 370 int64 MetricsLogBase::GetBuildTime() { |
| 371 static int64 integral_build_time = 0; | 371 static int64 integral_build_time = 0; |
| 372 if (!integral_build_time) { | 372 if (!integral_build_time) { |
| 373 Time time; | 373 Time time; |
| 374 const char* kDateTime = __DATE__ " " __TIME__ " GMT"; | 374 const char* kDateTime = __DATE__ " " __TIME__ " GMT"; |
| 375 bool result = Time::FromString(kDateTime, &time); | 375 bool result = Time::FromString(ASCIIToWide(kDateTime).c_str(), &time); |
| 376 DCHECK(result); | 376 DCHECK(result); |
| 377 integral_build_time = static_cast<int64>(time.ToTimeT()); | 377 integral_build_time = static_cast<int64>(time.ToTimeT()); |
| 378 } | 378 } |
| 379 return integral_build_time; | 379 return integral_build_time; |
| 380 } | 380 } |
| 381 | 381 |
| 382 MetricsLog* MetricsLogBase::AsMetricsLog() { | 382 MetricsLog* MetricsLogBase::AsMetricsLog() { |
| 383 return NULL; | 383 return NULL; |
| 384 } | 384 } |
| 385 | 385 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 snapshot.Subtract(*already_logged); | 585 snapshot.Subtract(*already_logged); |
| 586 } | 586 } |
| 587 | 587 |
| 588 // Snapshot now contains only a delta to what we've already_logged. | 588 // Snapshot now contains only a delta to what we've already_logged. |
| 589 if (snapshot.redundant_count() > 0) { | 589 if (snapshot.redundant_count() > 0) { |
| 590 TransmitHistogramDelta(histogram, snapshot); | 590 TransmitHistogramDelta(histogram, snapshot); |
| 591 // Add new data into our running total. | 591 // Add new data into our running total. |
| 592 already_logged->Add(snapshot); | 592 already_logged->Add(snapshot); |
| 593 } | 593 } |
| 594 } | 594 } |
| OLD | NEW |