| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/metrics/metrics_log.h" | 5 #include "components/metrics/metrics_log.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/base64.h" | 13 #include "base/base64.h" |
| 14 #include "base/build_time.h" | 14 #include "base/build_time.h" |
| 15 #include "base/cpu.h" | 15 #include "base/cpu.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/metrics/histogram_samples.h" | 18 #include "base/metrics/histogram_samples.h" |
| 19 #include "base/metrics/metrics_hashes.h" | 19 #include "base/metrics/metrics_hashes.h" |
| 20 #include "base/prefs/pref_registry_simple.h" | |
| 21 #include "base/prefs/pref_service.h" | |
| 22 #include "base/sha1.h" | 20 #include "base/sha1.h" |
| 23 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
| 27 #include "base/time/time.h" | 25 #include "base/time/time.h" |
| 28 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 29 #include "components/metrics/histogram_encoder.h" | 27 #include "components/metrics/histogram_encoder.h" |
| 30 #include "components/metrics/metrics_pref_names.h" | 28 #include "components/metrics/metrics_pref_names.h" |
| 31 #include "components/metrics/metrics_provider.h" | 29 #include "components/metrics/metrics_provider.h" |
| 32 #include "components/metrics/metrics_service_client.h" | 30 #include "components/metrics/metrics_service_client.h" |
| 33 #include "components/metrics/proto/histogram_event.pb.h" | 31 #include "components/metrics/proto/histogram_event.pb.h" |
| 34 #include "components/metrics/proto/system_profile.pb.h" | 32 #include "components/metrics/proto/system_profile.pb.h" |
| 35 #include "components/metrics/proto/user_action_event.pb.h" | 33 #include "components/metrics/proto/user_action_event.pb.h" |
| 34 #include "components/prefs/pref_registry_simple.h" |
| 35 #include "components/prefs/pref_service.h" |
| 36 #include "components/variations/active_field_trials.h" | 36 #include "components/variations/active_field_trials.h" |
| 37 | 37 |
| 38 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
| 39 #include "base/android/build_info.h" | 39 #include "base/android/build_info.h" |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
| 43 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx | 43 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx |
| 44 extern "C" IMAGE_DOS_HEADER __ImageBase; | 44 extern "C" IMAGE_DOS_HEADER __ImageBase; |
| 45 #endif | 45 #endif |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 DCHECK(!closed_); | 383 DCHECK(!closed_); |
| 384 closed_ = true; | 384 closed_ = true; |
| 385 } | 385 } |
| 386 | 386 |
| 387 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 387 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
| 388 DCHECK(closed_); | 388 DCHECK(closed_); |
| 389 uma_proto_.SerializeToString(encoded_log); | 389 uma_proto_.SerializeToString(encoded_log); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace metrics | 392 } // namespace metrics |
| OLD | NEW |