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 "chrome/browser/metrics/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 AndroidMetricsProvider::RegisterPrefs(registry); | 173 AndroidMetricsProvider::RegisterPrefs(registry); |
174 #endif // defined(OS_ANDROID) | 174 #endif // defined(OS_ANDROID) |
175 | 175 |
176 #if defined(ENABLE_PLUGINS) | 176 #if defined(ENABLE_PLUGINS) |
177 PluginMetricsProvider::RegisterPrefs(registry); | 177 PluginMetricsProvider::RegisterPrefs(registry); |
178 #endif // defined(ENABLE_PLUGINS) | 178 #endif // defined(ENABLE_PLUGINS) |
179 } | 179 } |
180 | 180 |
181 void ChromeMetricsServiceClient::SetMetricsClientId( | 181 void ChromeMetricsServiceClient::SetMetricsClientId( |
182 const std::string& client_id) { | 182 const std::string& client_id) { |
183 #if defined(OS_MACOSX) | |
184 crash_keys::SetMetricsClientIdFromGUID(client_id); | |
185 #else | |
183 crash_keys::SetCrashClientIdFromGUID(client_id); | 186 crash_keys::SetCrashClientIdFromGUID(client_id); |
187 #endif | |
188 } | |
189 | |
190 void ChromeMetricsServiceClient::RecordingDisabled() { | |
191 #if defined(OS_MACOSX) | |
192 crash_keys::ClearMetricsClientId(); | |
193 #endif | |
Ilya Sherman
2015/03/24 00:22:23
Optional: IMO, it would be nicer if the crash_keys
| |
184 } | 194 } |
185 | 195 |
186 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { | 196 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { |
187 return chrome::IsOffTheRecordSessionActive(); | 197 return chrome::IsOffTheRecordSessionActive(); |
188 } | 198 } |
189 | 199 |
190 int32 ChromeMetricsServiceClient::GetProduct() { | 200 int32 ChromeMetricsServiceClient::GetProduct() { |
191 return metrics::ChromeUserMetricsExtension::CHROME; | 201 return metrics::ChromeUserMetricsExtension::CHROME; |
192 } | 202 } |
193 | 203 |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 // Capture the histogram samples. | 605 // Capture the histogram samples. |
596 if (dumps_with_crash != 0) | 606 if (dumps_with_crash != 0) |
597 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 607 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
598 if (dumps_with_no_crash != 0) | 608 if (dumps_with_no_crash != 0) |
599 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 609 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
600 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 610 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
601 if (total_dumps != 0) | 611 if (total_dumps != 0) |
602 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 612 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
603 } | 613 } |
604 #endif // defined(OS_WIN) | 614 #endif // defined(OS_WIN) |
OLD | NEW |