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

Unified Diff: base/profiler/stack_sampling_profiler.h

Issue 1423583002: Stack sampling profiler: handle unloaded and unloading modules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: fix gcc compile Created 5 years, 1 month 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
« no previous file with comments | « base/profiler/native_stack_sampler_win.cc ('k') | base/profiler/stack_sampling_profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/stack_sampling_profiler.h
diff --git a/base/profiler/stack_sampling_profiler.h b/base/profiler/stack_sampling_profiler.h
index 9aa9c31d67afd31a12113f5caeeb1b53e3ae771e..e9b1804bbf282ee3cbc0d7764d306d6b563f4e41 100644
--- a/base/profiler/stack_sampling_profiler.h
+++ b/base/profiler/stack_sampling_profiler.h
@@ -20,6 +20,7 @@
namespace base {
class NativeStackSampler;
+class NativeStackSamplerTestDelegate;
// StackSamplingProfiler periodically stops a thread to sample its stack, for
// the purpose of collecting information about which code paths are
@@ -156,10 +157,15 @@ class BASE_EXPORT StackSamplingProfiler {
// thread-safe callback implementation.
using CompletedCallback = Callback<void(const CallStackProfiles&)>;
- // Creates a profiler that sends completed profiles to |callback|.
+ // Creates a profiler that sends completed profiles to |callback|. The second
+ // constructor is for test purposes.
StackSamplingProfiler(PlatformThreadId thread_id,
const SamplingParams& params,
const CompletedCallback& callback);
+ StackSamplingProfiler(PlatformThreadId thread_id,
+ const SamplingParams& params,
+ const CompletedCallback& callback,
+ NativeStackSamplerTestDelegate* test_delegate);
// Stops any profiling currently taking place before destroying the profiler.
~StackSamplingProfiler();
@@ -231,6 +237,9 @@ class BASE_EXPORT StackSamplingProfiler {
const CompletedCallback completed_callback_;
+ // Stored until it can be passed to the NativeStackSampler created in Start().
+ NativeStackSamplerTestDelegate* const test_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(StackSamplingProfiler);
};
« no previous file with comments | « base/profiler/native_stack_sampler_win.cc ('k') | base/profiler/stack_sampling_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698