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

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

Issue 2748463004: No 'prefs' state is necessary for an active file. (Closed)
Patch Set: fixed test Created 3 years, 9 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 | components/metrics/file_metrics_provider.h » ('j') | 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/chrome_metrics_service_client.h" 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // cleanly. 220 // cleanly.
221 RegisterOrRemovePreviousRunMetricsFile( 221 RegisterOrRemovePreviousRunMetricsFile(
222 metrics_reporting_enabled, user_data_dir, 222 metrics_reporting_enabled, user_data_dir,
223 kCrashpadHistogramAllocatorName, task_runner, 223 kCrashpadHistogramAllocatorName, task_runner,
224 file_metrics_provider.get()); 224 file_metrics_provider.get());
225 if (metrics_reporting_enabled) { 225 if (metrics_reporting_enabled) {
226 base::FilePath active_path; 226 base::FilePath active_path;
227 base::GlobalHistogramAllocator::ConstructFilePaths( 227 base::GlobalHistogramAllocator::ConstructFilePaths(
228 user_data_dir, kCrashpadHistogramAllocatorName, nullptr, 228 user_data_dir, kCrashpadHistogramAllocatorName, nullptr,
229 &active_path); 229 &active_path);
230 // Register data that will be populated for the current run. 230 // Register data that will be populated for the current run. "Active"
231 // files need an empty "prefs_key" because they update the file itself.
231 file_metrics_provider->RegisterSource( 232 file_metrics_provider->RegisterSource(
232 active_path, 233 active_path,
233 metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ACTIVE_FILE, 234 metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ACTIVE_FILE,
234 metrics::FileMetricsProvider::ASSOCIATE_CURRENT_RUN, 235 metrics::FileMetricsProvider::ASSOCIATE_CURRENT_RUN,
235 kCrashpadHistogramAllocatorName); 236 base::StringPiece());
236 } 237 }
237 } 238 }
238 239
239 #if defined(OS_WIN) 240 #if defined(OS_WIN)
240 // Read metrics file from setup.exe. 241 // Read metrics file from setup.exe.
241 base::FilePath program_dir; 242 base::FilePath program_dir;
242 base::PathService::Get(base::DIR_EXE, &program_dir); 243 base::PathService::Get(base::DIR_EXE, &program_dir);
243 file_metrics_provider->RegisterSource( 244 file_metrics_provider->RegisterSource(
244 program_dir.AppendASCII(installer::kSetupHistogramAllocatorName), 245 program_dir.AppendASCII(installer::kSetupHistogramAllocatorName),
245 metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ATOMIC_DIR, 246 metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ATOMIC_DIR,
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 ukm_service_->Purge(); 961 ukm_service_->Purge();
961 ukm_service_->ResetClientId(); 962 ukm_service_->ResetClientId();
962 } 963 }
963 // Signal service manager to enable/disable UKM based on new state. 964 // Signal service manager to enable/disable UKM based on new state.
964 UpdateRunningServices(); 965 UpdateRunningServices();
965 } 966 }
966 967
967 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() { 968 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() {
968 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles(); 969 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles();
969 } 970 }
OLDNEW
« no previous file with comments | « no previous file | components/metrics/file_metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698