Index: chrome/browser/metrics/call_stack_profile_metrics_provider.h |
diff --git a/chrome/browser/metrics/call_stack_profile_metrics_provider.h b/chrome/browser/metrics/call_stack_profile_metrics_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8402006965aaebd9bf66bfe4192748e1d37fdf1d |
--- /dev/null |
+++ b/chrome/browser/metrics/call_stack_profile_metrics_provider.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
+#define CHROME_BROWSER_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
+ |
+#include <vector> |
+ |
+#include "base/profiler/stack_sampling_profiler.h" |
+#include "components/metrics/metrics_provider.h" |
+ |
+namespace metrics { |
+class ChromeUserMetricsExtension; |
+} |
+ |
+// Performs metrics logging for the stack sampling profiler. |
+class CallStackProfileMetricsProvider : public metrics::MetricsProvider { |
Alexei Svitkine (slow)
2015/03/17 23:10:10
If this only depends on code in base and the metri
Mike Wittman
2015/03/18 01:48:35
Done.
|
+ public: |
+ CallStackProfileMetricsProvider(); |
+ ~CallStackProfileMetricsProvider() override; |
+ |
+ // metrics::MetricsProvider: |
+ void ProvideGeneralMetrics( |
+ metrics::ChromeUserMetricsExtension* uma_proto) override; |
+ |
+ // Uses |profiles| as the source data for the next invocation of |
+ // ProvideGeneralMetrics, rather than sourcing them from the |
+ // StackSamplingProfiler. |
+ void SetSourceProfilesForTest( |
Alexei Svitkine (slow)
2015/03/17 23:10:10
Nit: metrics code prefers ForTesting
Mike Wittman
2015/03/18 01:48:36
Done.
|
+ const std::vector<base::StackSamplingProfiler::Profile>& profiles); |
+ |
+ private: |
+ std::vector<base::StackSamplingProfiler::Profile> source_profiles_for_test_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider); |
+}; |
+ |
+#endif // CHROME_BROWSER_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |