| 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // the external server, and the user shuts down, then a copy of the log may be | 138 // the external server, and the user shuts down, then a copy of the log may be |
| 139 // saved for re-transmission. These duplicates could be filtered out server | 139 // saved for re-transmission. These duplicates could be filtered out server |
| 140 // side, but are not expected to be a significant problem. | 140 // side, but are not expected to be a significant problem. |
| 141 // | 141 // |
| 142 // | 142 // |
| 143 //------------------------------------------------------------------------------ | 143 //------------------------------------------------------------------------------ |
| 144 | 144 |
| 145 #include "chrome/browser/metrics/metrics_service.h" | 145 #include "chrome/browser/metrics/metrics_service.h" |
| 146 | 146 |
| 147 #include "base/bind.h" | 147 #include "base/bind.h" |
| 148 #include "base/guid.h" |
| 148 #include "base/callback.h" | 149 #include "base/callback.h" |
| 149 #include "base/command_line.h" | 150 #include "base/command_line.h" |
| 150 #include "base/md5.h" | 151 #include "base/md5.h" |
| 151 #include "base/metrics/histogram.h" | 152 #include "base/metrics/histogram.h" |
| 152 #include "base/rand_util.h" | 153 #include "base/rand_util.h" |
| 153 #include "base/string_number_conversions.h" | 154 #include "base/string_number_conversions.h" |
| 154 #include "base/threading/platform_thread.h" | 155 #include "base/threading/platform_thread.h" |
| 155 #include "base/threading/thread.h" | 156 #include "base/threading/thread.h" |
| 156 #include "base/threading/thread_restrictions.h" | 157 #include "base/threading/thread_restrictions.h" |
| 157 #include "base/tracked_objects.h" | 158 #include "base/tracked_objects.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 171 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 172 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
| 172 #include "chrome/browser/net/network_stats.h" | 173 #include "chrome/browser/net/network_stats.h" |
| 173 #include "chrome/browser/prefs/pref_service.h" | 174 #include "chrome/browser/prefs/pref_service.h" |
| 174 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 175 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 175 #include "chrome/browser/profiles/profile.h" | 176 #include "chrome/browser/profiles/profile.h" |
| 176 #include "chrome/browser/search_engines/template_url_service.h" | 177 #include "chrome/browser/search_engines/template_url_service.h" |
| 177 #include "chrome/browser/ui/browser_list.h" | 178 #include "chrome/browser/ui/browser_list.h" |
| 178 #include "chrome/common/child_process_logging.h" | 179 #include "chrome/common/child_process_logging.h" |
| 179 #include "chrome/common/chrome_notification_types.h" | 180 #include "chrome/common/chrome_notification_types.h" |
| 180 #include "chrome/common/chrome_switches.h" | 181 #include "chrome/common/chrome_switches.h" |
| 181 #include "chrome/common/guid.h" | |
| 182 #include "chrome/common/metrics/metrics_log_manager.h" | 182 #include "chrome/common/metrics/metrics_log_manager.h" |
| 183 #include "chrome/common/net/test_server_locations.h" | 183 #include "chrome/common/net/test_server_locations.h" |
| 184 #include "chrome/common/pref_names.h" | 184 #include "chrome/common/pref_names.h" |
| 185 #include "chrome/common/render_messages.h" | 185 #include "chrome/common/render_messages.h" |
| 186 #include "content/public/browser/child_process_data.h" | 186 #include "content/public/browser/child_process_data.h" |
| 187 #include "content/public/browser/load_notification_details.h" | 187 #include "content/public/browser/load_notification_details.h" |
| 188 #include "content/public/browser/notification_service.h" | 188 #include "content/public/browser/notification_service.h" |
| 189 #include "content/public/browser/plugin_service.h" | 189 #include "content/public/browser/plugin_service.h" |
| 190 #include "content/public/browser/render_process_host.h" | 190 #include "content/public/browser/render_process_host.h" |
| 191 #include "content/public/common/url_fetcher.h" | 191 #include "content/public/common/url_fetcher.h" |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1821 if (local_state) { | 1821 if (local_state) { |
| 1822 const PrefService::Preference* uma_pref = | 1822 const PrefService::Preference* uma_pref = |
| 1823 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1823 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
| 1824 if (uma_pref) { | 1824 if (uma_pref) { |
| 1825 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1825 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
| 1826 DCHECK(success); | 1826 DCHECK(success); |
| 1827 } | 1827 } |
| 1828 } | 1828 } |
| 1829 return result; | 1829 return result; |
| 1830 } | 1830 } |
| OLD | NEW |