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

Unified Diff: components/metrics/public/cpp/call_stack_profile_struct_traits.h

Issue 2927593002: Make stack sampling profiler sample beyond startup. (Closed)
Patch Set: Remove debug log statements. Created 3 years, 5 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/public/cpp/call_stack_profile_struct_traits.h
diff --git a/components/metrics/public/cpp/call_stack_profile_struct_traits.h b/components/metrics/public/cpp/call_stack_profile_struct_traits.h
index ddf78d5f3c9b5139d02803ea5d8ed4e7f3844cb5..6a3af7cf363cf628cd1d5bbb9226218338d2591b 100644
--- a/components/metrics/public/cpp/call_stack_profile_struct_traits.h
+++ b/components/metrics/public/cpp/call_stack_profile_struct_traits.h
@@ -5,9 +5,11 @@
// Defines StructTraits specializations for translating between mojo types and
// base::StackSamplingProfiler types, with data validity checks.
-#ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_STRUCT_TRAITS_H_
-#define COMPONENTS_METRICS_CALL_STACK_PROFILE_STRUCT_TRAITS_H_
+#ifndef COMPONENTS_METRICS_PUBLIC_CPP_CALL_STACK_PROFILE_STRUCT_TRAITS_H_
+#define COMPONENTS_METRICS_PUBLIC_CPP_CALL_STACK_PROFILE_STRUCT_TRAITS_H_
+#include <string>
+#include <utility>
#include <vector>
#include "base/files/file_path.h"
@@ -307,6 +309,8 @@ struct EnumTraits<metrics::mojom::Trigger,
return metrics::mojom::Trigger::JANKY_TASK;
case metrics::CallStackProfileParams::Trigger::THREAD_HUNG:
return metrics::mojom::Trigger::THREAD_HUNG;
+ case metrics::CallStackProfileParams::Trigger::PERIODIC_COLLECTION:
+ return metrics::mojom::Trigger::PERIODIC_COLLECTION;
}
NOTREACHED();
return metrics::mojom::Trigger::UNKNOWN;
@@ -327,6 +331,9 @@ struct EnumTraits<metrics::mojom::Trigger,
case metrics::mojom::Trigger::THREAD_HUNG:
*out = metrics::CallStackProfileParams::Trigger::THREAD_HUNG;
return true;
+ case metrics::mojom::Trigger::PERIODIC_COLLECTION:
+ *out = metrics::CallStackProfileParams::Trigger::PERIODIC_COLLECTION;
+ return true;
}
return false;
}
@@ -371,7 +378,6 @@ struct StructTraits<metrics::mojom::CallStackProfileParamsDataView,
template <>
struct EnumTraits<metrics::mojom::SampleOrderingSpec,
metrics::CallStackProfileParams::SampleOrderingSpec> {
-
static metrics::mojom::SampleOrderingSpec ToMojom(
metrics::CallStackProfileParams::SampleOrderingSpec spec) {
switch (spec) {
@@ -400,6 +406,6 @@ struct EnumTraits<metrics::mojom::SampleOrderingSpec,
}
};
-} // mojo
+} // namespace mojo
-#endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_STRUCT_TRAITS_H_
+#endif // COMPONENTS_METRICS_PUBLIC_CPP_CALL_STACK_PROFILE_STRUCT_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698