| 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 "chrome/browser/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 std::vector<NameGroupId> field_trial_ids; | 780 std::vector<NameGroupId> field_trial_ids; |
| 781 GetFieldTrialIds(&field_trial_ids); | 781 GetFieldTrialIds(&field_trial_ids); |
| 782 WriteFieldTrials(field_trial_ids, system_profile); | 782 WriteFieldTrials(field_trial_ids, system_profile); |
| 783 } | 783 } |
| 784 | 784 |
| 785 void MetricsLog::RecordProfilerData( | 785 void MetricsLog::RecordProfilerData( |
| 786 const tracked_objects::ProcessDataSnapshot& process_data, | 786 const tracked_objects::ProcessDataSnapshot& process_data, |
| 787 content::ProcessType process_type) { | 787 content::ProcessType process_type) { |
| 788 DCHECK(!locked()); | 788 DCHECK(!locked()); |
| 789 | 789 |
| 790 if (tracked_objects::GetAlternateTimeSource()) { | 790 if (tracked_objects::GetTimeSourceType() != |
| 791 tracked_objects::TIME_SOURCE_TYPE_WALL_TIME) { |
| 791 // We currently only support the default time source, wall clock time. | 792 // We currently only support the default time source, wall clock time. |
| 792 return; | 793 return; |
| 793 } | 794 } |
| 794 | 795 |
| 795 ProfilerEventProto* profile; | 796 ProfilerEventProto* profile; |
| 796 if (!uma_proto()->profiler_event_size()) { | 797 if (!uma_proto()->profiler_event_size()) { |
| 797 // For the first process's data, add a new field to the protocol buffer. | 798 // For the first process's data, add a new field to the protocol buffer. |
| 798 profile = uma_proto()->add_profiler_event(); | 799 profile = uma_proto()->add_profiler_event(); |
| 799 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); | 800 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); |
| 800 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); | 801 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 i != log.result.end(); ++i) { | 942 i != log.result.end(); ++i) { |
| 942 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion(); | 943 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion(); |
| 943 suggestion->set_provider(AsOmniboxEventProviderType(i->provider)); | 944 suggestion->set_provider(AsOmniboxEventProviderType(i->provider)); |
| 944 suggestion->set_result_type(AsOmniboxEventResultType(i->type)); | 945 suggestion->set_result_type(AsOmniboxEventResultType(i->type)); |
| 945 suggestion->set_relevance(i->relevance); | 946 suggestion->set_relevance(i->relevance); |
| 946 suggestion->set_is_starred(i->starred); | 947 suggestion->set_is_starred(i->starred); |
| 947 } | 948 } |
| 948 | 949 |
| 949 ++num_events_; | 950 ++num_events_; |
| 950 } | 951 } |
| OLD | NEW |