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

Unified Diff: base/profiler/native_stack_sampler_win.cc

Issue 2702463003: NativeStackSampler implementation for Mac. (Closed)
Patch Set: rev Created 3 years, 9 months 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_mac.cc ('k') | base/profiler/stack_sampling_profiler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/native_stack_sampler_win.cc
diff --git a/base/profiler/native_stack_sampler_win.cc b/base/profiler/native_stack_sampler_win.cc
index e1605109fe960d769523733b2a1190700b250d28..d320fea98a1cc778fe69d6d519d056a00d308820 100644
--- a/base/profiler/native_stack_sampler_win.cc
+++ b/base/profiler/native_stack_sampler_win.cc
@@ -398,14 +398,12 @@ class NativeStackSamplerWin : public NativeStackSampler {
void ProfileRecordingStopped() override;
private:
- enum {
- // Intended to hold the largest stack used by Chrome. The default Win32
- // reserved stack size is 1 MB and Chrome Windows threads currently always
- // use the default, but this allows for expansion if it occurs. The size
- // beyond the actual stack size consists of unallocated virtual memory pages
- // so carries little cost (just a bit of wasted address space).
- kStackCopyBufferSize = 2 * 1024 * 1024
- };
+ // Intended to hold the largest stack used by Chrome. The default Win32
+ // reserved stack size is 1 MB and Chrome Windows threads currently always
+ // use the default, but this allows for expansion if it occurs. The size
+ // beyond the actual stack size consists of unallocated virtual memory pages
+ // so carries little cost (just a bit of wasted address space).
+ static constexpr size_t kStackCopyBufferSize = 2 * 1024 * 1024;
// Attempts to query the module filename, base address, and id for
// |module_handle|, and store them in |module|. Returns true if it succeeded.
@@ -474,9 +472,6 @@ void NativeStackSamplerWin::RecordStackSample(
StackSamplingProfiler::Sample* sample) {
DCHECK(current_modules_);
- if (!stack_copy_buffer_)
- return;
-
std::vector<RecordedFrame> stack;
SuspendThreadAndRecordStack(thread_handle_.Get(), thread_stack_base_address_,
stack_copy_buffer_.get(), kStackCopyBufferSize,
« no previous file with comments | « base/profiler/native_stack_sampler_mac.cc ('k') | base/profiler/stack_sampling_profiler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698