Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: chrome/browser/metrics/chromeos_metrics_provider.cc

Issue 1905793002: Enable Runtime Memory Leak Detector on x86_64 only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromeos_metrics_provider.h" 5 #include "chrome/browser/metrics/chromeos_metrics_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 138 g_browser_process->platform_part()->browser_policy_connector_chromeos();
139 if (!connector) 139 if (!connector)
140 return ERROR_GETTING_ENROLLMENT_STATUS; 140 return ERROR_GETTING_ENROLLMENT_STATUS;
141 141
142 return connector->IsEnterpriseManaged() ? MANAGED : NON_MANAGED; 142 return connector->IsEnterpriseManaged() ? MANAGED : NON_MANAGED;
143 } 143 }
144 144
145 void ChromeOSMetricsProvider::Init() { 145 void ChromeOSMetricsProvider::Init() {
146 perf_provider_.Init(); 146 perf_provider_.Init();
147 147
148 #if defined(ARCH_CPU_X86_64)
149 // Currently, the runtime memory leak detector is only supported on x86_64
150 // systems.
148 if (base::FeatureList::IsEnabled(features::kRuntimeMemoryLeakDetector)) { 151 if (base::FeatureList::IsEnabled(features::kRuntimeMemoryLeakDetector)) {
149 leak_detector_controller_.reset(new metrics::LeakDetectorController); 152 leak_detector_controller_.reset(new metrics::LeakDetectorController);
150 } 153 }
154 #endif
151 } 155 }
152 156
153 void ChromeOSMetricsProvider::OnDidCreateMetricsLog() { 157 void ChromeOSMetricsProvider::OnDidCreateMetricsLog() {
154 registered_user_count_at_log_initialization_ = false; 158 registered_user_count_at_log_initialization_ = false;
155 if (user_manager::UserManager::IsInitialized()) { 159 if (user_manager::UserManager::IsInitialized()) {
156 registered_user_count_at_log_initialization_ = true; 160 registered_user_count_at_log_initialization_ = true;
157 user_count_at_log_initialization_ = 161 user_count_at_log_initialization_ =
158 user_manager::UserManager::Get()->GetLoggedInUsers().size(); 162 user_manager::UserManager::Get()->GetLoggedInUsers().size();
159 } 163 }
160 } 164 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 base::Closure callback, 317 base::Closure callback,
314 scoped_refptr<device::BluetoothAdapter> adapter) { 318 scoped_refptr<device::BluetoothAdapter> adapter) {
315 adapter_ = adapter; 319 adapter_ = adapter;
316 callback.Run(); 320 callback.Run();
317 } 321 }
318 322
319 void ChromeOSMetricsProvider::RecordEnrollmentStatus() { 323 void ChromeOSMetricsProvider::RecordEnrollmentStatus() {
320 UMA_HISTOGRAM_ENUMERATION( 324 UMA_HISTOGRAM_ENUMERATION(
321 "UMA.EnrollmentStatus", GetEnrollmentStatus(), ENROLLMENT_STATUS_MAX); 325 "UMA.EnrollmentStatus", GetEnrollmentStatus(), ENROLLMENT_STATUS_MAX);
322 } 326 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698