Commit 2dedff94 authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Fix declaration order in CallStackProfileBuilder

Bug: 851163
Change-Id: Ided8d0c3fc6006e4296362d840a6f03aec093d1b
Reviewed-on: https://chromium-review.googlesource.com/1175066
Commit-Queue: Xi Cheng <chengx@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583173}
parent f795f24d
...@@ -31,6 +31,19 @@ namespace metrics { ...@@ -31,6 +31,19 @@ namespace metrics {
class CallStackProfileBuilder class CallStackProfileBuilder
: public base::StackSamplingProfiler::ProfileBuilder { : public base::StackSamplingProfiler::ProfileBuilder {
public: public:
// The callback type used to collect a SampledProfile protocol buffer message.
// The passed SampledProfile is move-only. Other threads, including the UI
// thread, may block on callback completion so this should run as quickly as
// possible.
//
// IMPORTANT NOTE: The callback is invoked on a thread the profiler
// constructs, rather than on the thread used to construct the profiler, and
// thus the callback must be callable on any thread. For threads with message
// loops that create CallStackProfileBuilders, posting a task to the message
// loop with the moved (i.e. std::move) profile is the thread-safe callback
// implementation.
using CompletedCallback = base::RepeatingCallback<void(SampledProfile)>;
// Frame represents an individual sampled stack frame with module information. // Frame represents an individual sampled stack frame with module information.
struct Frame { struct Frame {
Frame(uintptr_t instruction_pointer, size_t module_index); Frame(uintptr_t instruction_pointer, size_t module_index);
...@@ -84,19 +97,6 @@ class CallStackProfileBuilder ...@@ -84,19 +97,6 @@ class CallStackProfileBuilder
MILESTONES_MAX_VALUE MILESTONES_MAX_VALUE
}; };
// The callback type used to collect a metrics.SampledProfile protocol
// message. The passed SampledProfile is move-only. Other threads, including
// the UI thread, may block on callback completion so this should run as
// quickly as possible.
//
// IMPORTANT NOTE: The callback is invoked on a thread the profiler
// constructs, rather than on the thread used to construct the profiler, and
// thus the callback must be callable on any thread. For threads with message
// loops that create CallStackProfileBuilders, posting a task to the message
// loop with the moved (i.e. std::move) profile is the thread-safe callback
// implementation.
using CompletedCallback = base::RepeatingCallback<void(SampledProfile)>;
CallStackProfileBuilder(const CompletedCallback& callback, CallStackProfileBuilder(const CompletedCallback& callback,
const CallStackProfileParams& profile_params); const CallStackProfileParams& profile_params);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment