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

Unified Diff: base/profiler/native_stack_sampler.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/base.gyp ('k') | base/profiler/native_stack_sampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/native_stack_sampler.h
diff --git a/base/profiler/native_stack_sampler.h b/base/profiler/native_stack_sampler.h
index bc170dcf933e6e9bc7554fda261182a142178f75..40be5cd2973e15419420da8427d6d172fd838607 100644
--- a/base/profiler/native_stack_sampler.h
+++ b/base/profiler/native_stack_sampler.h
@@ -5,12 +5,16 @@
#ifndef BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
#define BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
+#include "base/base_export.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/profiler/stack_sampling_profiler.h"
#include "base/threading/platform_thread.h"
namespace base {
+class NativeStackSamplerTestDelegate;
+
// NativeStackSampler is an implementation detail of StackSamplingProfiler. It
// abstracts the native implementation required to record a stack sample for a
// given thread.
@@ -20,7 +24,9 @@ class NativeStackSampler {
// Creates a stack sampler that records samples for |thread_handle|. Returns
// null if this platform does not support stack sampling.
- static scoped_ptr<NativeStackSampler> Create(PlatformThreadId thread_id);
+ static scoped_ptr<NativeStackSampler> Create(
+ PlatformThreadId thread_id,
+ NativeStackSamplerTestDelegate* test_delegate);
// The following functions are all called on the SamplingThread (not the
// thread being sampled).
@@ -44,6 +50,23 @@ class NativeStackSampler {
DISALLOW_COPY_AND_ASSIGN(NativeStackSampler);
};
+// NativeStackSamplerTestDelegate provides seams for test code to execute during
+// stack collection.
+class BASE_EXPORT NativeStackSamplerTestDelegate {
+ public:
+ virtual ~NativeStackSamplerTestDelegate();
+
+ // Called after copying the stack and resuming the target thread, but prior to
+ // walking the stack. Invoked on the SamplingThread.
+ virtual void OnPreStackWalk() = 0;
+
+ protected:
+ NativeStackSamplerTestDelegate();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NativeStackSamplerTestDelegate);
+};
+
} // namespace base
#endif // BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
« no previous file with comments | « base/base.gyp ('k') | base/profiler/native_stack_sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698