Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ | 5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
| 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ | 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 // StackSamplingProfilers. This function may be called on any thread. | 28 // StackSamplingProfilers. This function may be called on any thread. |
| 29 static base::StackSamplingProfiler::CompletedCallback GetProfilerCallback( | 29 static base::StackSamplingProfiler::CompletedCallback GetProfilerCallback( |
| 30 const CallStackProfileParams& params); | 30 const CallStackProfileParams& params); |
| 31 | 31 |
| 32 // Provides completed stack profiles to the metrics provider. Intended for use | 32 // Provides completed stack profiles to the metrics provider. Intended for use |
| 33 // when receiving profiles over IPC. In-process StackSamplingProfiler users | 33 // when receiving profiles over IPC. In-process StackSamplingProfiler users |
| 34 // should use GetProfilerCallback() instead. | 34 // should use GetProfilerCallback() instead. |
| 35 static void ReceiveCompletedProfiles( | 35 static void ReceiveCompletedProfiles( |
| 36 const CallStackProfileParams& params, | 36 const CallStackProfileParams& params, |
| 37 base::TimeTicks start_timestamp, | 37 base::TimeTicks start_timestamp, |
| 38 const base::StackSamplingProfiler::CallStackProfiles& profiles); | 38 base::StackSamplingProfiler::CallStackProfiles profiles); |
|
Alexei Svitkine (slow)
2016/10/24 15:26:22
Passing by non-const ref that results in a copy is
bcwhite
2016/10/24 21:30:30
CallStackProfiles doesn't allow copy so only std::
Alexei Svitkine (slow)
2016/10/25 14:34:04
Sorry, I don't think I'm following. But maybe I do
bcwhite
2016/10/25 15:01:04
std::vector supports both copy and move constructi
Alexei Svitkine (slow)
2016/10/25 15:21:18
OK, so given the above, please add a comment to ea
bcwhite
2016/10/25 17:16:21
Done.
| |
| 39 | 39 |
| 40 // MetricsProvider: | 40 // MetricsProvider: |
| 41 void OnRecordingEnabled() override; | 41 void OnRecordingEnabled() override; |
| 42 void OnRecordingDisabled() override; | 42 void OnRecordingDisabled() override; |
| 43 void ProvideGeneralMetrics(ChromeUserMetricsExtension* uma_proto) override; | 43 void ProvideGeneralMetrics(ChromeUserMetricsExtension* uma_proto) override; |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 // Finch field trial and group for reporting profiles. Provided here for test | 46 // Finch field trial and group for reporting profiles. Provided here for test |
| 47 // use. | 47 // use. |
| 48 static const char kFieldTrialName[]; | 48 static const char kFieldTrialName[]; |
| 49 static const char kReportProfilesGroupName[]; | 49 static const char kReportProfilesGroupName[]; |
| 50 | 50 |
| 51 // Reset the static state to the defaults after startup. | 51 // Reset the static state to the defaults after startup. |
| 52 static void ResetStaticStateForTesting(); | 52 static void ResetStaticStateForTesting(); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // Returns true if reporting of profiles is enabled according to the | 55 // Returns true if reporting of profiles is enabled according to the |
| 56 // controlling Finch field trial. | 56 // controlling Finch field trial. |
| 57 static bool IsReportingEnabledByFieldTrial(); | 57 static bool IsReportingEnabledByFieldTrial(); |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider); | 59 DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace metrics | 62 } // namespace metrics |
| 63 | 63 |
| 64 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ | 64 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
| OLD | NEW |