Index: base/profiler/stack_sampling_profiler.h |
diff --git a/base/profiler/stack_sampling_profiler.h b/base/profiler/stack_sampling_profiler.h |
index a5e30e9fa0e892c0c588be2ea1ce1f144d2c741c..16481bce7fd22617f16b6d5d4efe4f4e23e81176 100644 |
--- a/base/profiler/stack_sampling_profiler.h |
+++ b/base/profiler/stack_sampling_profiler.h |
@@ -16,6 +16,7 @@ |
#include "base/callback.h" |
#include "base/files/file_path.h" |
#include "base/macros.h" |
+#include "base/optional.h" |
#include "base/strings/string16.h" |
#include "base/synchronization/waitable_event.h" |
#include "base/threading/platform_thread.h" |
@@ -215,13 +216,18 @@ class BASE_EXPORT StackSamplingProfiler { |
// are move-only. Other threads, including the UI thread, may block on |
// callback completion so this should run as quickly as possible. |
// |
+ // After collection completion, the callback may instruct the profiler to do |
+ // additional collection(s) by returning a SamplingParams object to indicate |
+ // collection should be started again. |
+ // |
// IMPORTANT NOTE: The callback is invoked on a thread the profiler |
// constructs, rather than on the thread used to construct the profiler and |
// set the callback, and thus the callback must be callable on any thread. For |
// threads with message loops that create StackSamplingProfilers, posting a |
// task to the message loop with the moved (i.e. std::move) profiles is the |
// thread-safe callback implementation. |
- using CompletedCallback = Callback<void(CallStackProfiles)>; |
+ using CompletedCallback = |
+ Callback<Optional<SamplingParams>(CallStackProfiles)>; |
// Creates a profiler for the CURRENT thread that sends completed profiles |
// to |callback|. An optional |test_delegate| can be supplied by tests. |