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

Unified Diff: components/metrics/file_metrics_provider.cc

Issue 2918533003: Send metrics with embedded system profiles after system startup. (Closed)
Patch Set: load profile from only the first found source Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/file_metrics_provider.cc
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc
index d9a6a042c23ce137a1f0deac417e7f81ffb61f14..956c3cfd67ac9913345f72cd8d1f8ac81a7957f3 100644
--- a/components/metrics/file_metrics_provider.cc
+++ b/components/metrics/file_metrics_provider.cc
@@ -20,6 +20,7 @@
#include "base/time/time.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_service.h"
+#include "components/metrics/persistent_system_profile.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
@@ -487,6 +488,18 @@ void FileMetricsProvider::OnDidCreateMetricsLog() {
sources_for_previous_run_.clear();
}
+bool FileMetricsProvider::ProvideStabilitySystemProfile(
+ SystemProfileProto* system_profile_proto) {
+ for (const std::unique_ptr<SourceInfo>& source : sources_for_previous_run_) {
+ DCHECK(source->allocator);
+ if (PersistentSystemProfile::GetSystemProfile(
+ *source->allocator->memory_allocator(), system_profile_proto)) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool FileMetricsProvider::HasInitialStabilityMetrics() {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698