Index: content/common/profiled_stack_state.h |
diff --git a/content/common/profiled_stack_state.h b/content/common/profiled_stack_state.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2df205e6dd2217a9d50ac8251aa00c340a50ec17 |
--- /dev/null |
+++ b/content/common/profiled_stack_state.h |
@@ -0,0 +1,57 @@ |
+// 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 CONTENT_COMMON_PROFILED_STACK_STATE_H_ |
+#define CONTENT_COMMON_PROFILED_STACK_STATE_H_ |
+ |
+#include "base/profiler/stack_sampling_profiler.h" |
+#include "content/common/content_export.h" |
+ |
+namespace base { |
+class TimeTicks; |
Mike Wittman
2015/09/03 16:58:04
This should be an include. Forward declaration is
sydli
2015/09/03 17:18:13
Ah, that makes sense. Done.
|
+} // namespace base |
+ |
+namespace content { |
+ |
+// Profiled stacks and related metrics provider parameters |
+// to send to UMA. Duplicated Trigger enum for IPC usage. |
+struct CONTENT_EXPORT ProfiledStackState { |
+ // Keep this enum in sync with |
+ // components/metrics/call_stack_profile_metrics_provider.h |
+ enum Trigger { |
+ UNKNOWN, |
+ PROCESS_STARTUP, |
+ JANKY_TASK, |
+ THREAD_HUNG, |
+ TRIGGER_LAST = THREAD_HUNG |
+ }; |
+ |
+ ProfiledStackState( |
+ Trigger trigger, |
+ bool preserve_sample_ordering, |
+ base::TimeTicks start_timestamp, |
+ const base::StackSamplingProfiler::CallStackProfiles& profiles); |
+ |
+ // Default constructor and destrucor exposed to satisfy IPC macros. |
Mike Wittman
2015/09/03 16:58:04
nit: this should only refer to the constructor; us
sydli
2015/09/03 17:18:13
Done.
|
+ // Do not use explicitly. |
+ ProfiledStackState(); |
+ ~ProfiledStackState(); |
+ |
+ // The triggering event. |
+ Trigger trigger; |
+ |
+ // True if sample ordering is important and should be preserved when the |
+ // associated profiles are compressed. |
+ bool preserve_sample_ordering; |
+ |
+ // Time of profiling start. |
+ base::TimeTicks start_timestamp; |
+ |
+ // Collected stack profiles. |
+ base::StackSamplingProfiler::CallStackProfiles profiles; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_PROFILED_STACK_STATE_H_ |