| 1 | // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/profiler/stack_sampler.h" |
| 6 | |
| 7 | #include "base/memory/ptr_util.h" |
| 8 | #include "base/profiler/stack_buffer.h" |
| 9 | |
| 10 | namespace base { |
| 11 | |
| 12 | StackSampler::StackSampler() = default; |
| 13 | |
| 14 | StackSampler::~StackSampler() = default; |
| 15 | |
| 16 | std::unique_ptr<StackBuffer> StackSampler::CreateStackBuffer() { |
| 17 | size_t size = GetStackBufferSize(); |
| 18 | if (size == 0) |
| 19 | return nullptr; |
| 20 | return std::make_unique<StackBuffer>(size); |
| 21 | } |
| 22 | |
| 23 | StackSamplerTestDelegate::~StackSamplerTestDelegate() = default; |
| 24 | |
| 25 | StackSamplerTestDelegate::StackSamplerTestDelegate() = default; |
| 26 | |
| 27 | } // namespace base |
| 28 | |