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

Side by Side Diff: base/profiler/native_stack_sampler.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/process/process_win.cc ('k') | base/profiler/native_stack_sampler_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_PROFILER_NATIVE_STACK_SAMPLER_H_ 5 #ifndef BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
6 #define BASE_PROFILER_NATIVE_STACK_SAMPLER_H_ 6 #define BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
7 7
8 #include <memory>
9
8 #include "base/base_export.h" 10 #include "base/base_export.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/profiler/stack_sampling_profiler.h" 12 #include "base/profiler/stack_sampling_profiler.h"
12 #include "base/threading/platform_thread.h" 13 #include "base/threading/platform_thread.h"
13 14
14 namespace base { 15 namespace base {
15 16
16 class NativeStackSamplerTestDelegate; 17 class NativeStackSamplerTestDelegate;
17 18
18 // NativeStackSampler is an implementation detail of StackSamplingProfiler. It 19 // NativeStackSampler is an implementation detail of StackSamplingProfiler. It
19 // abstracts the native implementation required to record a stack sample for a 20 // abstracts the native implementation required to record a stack sample for a
20 // given thread. 21 // given thread.
21 class NativeStackSampler { 22 class NativeStackSampler {
22 public: 23 public:
23 virtual ~NativeStackSampler(); 24 virtual ~NativeStackSampler();
24 25
25 // Creates a stack sampler that records samples for |thread_handle|. Returns 26 // Creates a stack sampler that records samples for |thread_handle|. Returns
26 // null if this platform does not support stack sampling. 27 // null if this platform does not support stack sampling.
27 static scoped_ptr<NativeStackSampler> Create( 28 static std::unique_ptr<NativeStackSampler> Create(
28 PlatformThreadId thread_id, 29 PlatformThreadId thread_id,
29 NativeStackSamplerTestDelegate* test_delegate); 30 NativeStackSamplerTestDelegate* test_delegate);
30 31
31 // The following functions are all called on the SamplingThread (not the 32 // The following functions are all called on the SamplingThread (not the
32 // thread being sampled). 33 // thread being sampled).
33 34
34 // Notifies the sampler that we're starting to record a new profile. Modules 35 // Notifies the sampler that we're starting to record a new profile. Modules
35 // shared across samples in the profile should be recorded in |modules|. 36 // shared across samples in the profile should be recorded in |modules|.
36 virtual void ProfileRecordingStarting( 37 virtual void ProfileRecordingStarting(
37 std::vector<StackSamplingProfiler::Module>* modules) = 0; 38 std::vector<StackSamplingProfiler::Module>* modules) = 0;
(...skipping 26 matching lines...) Expand all
64 NativeStackSamplerTestDelegate(); 65 NativeStackSamplerTestDelegate();
65 66
66 private: 67 private:
67 DISALLOW_COPY_AND_ASSIGN(NativeStackSamplerTestDelegate); 68 DISALLOW_COPY_AND_ASSIGN(NativeStackSamplerTestDelegate);
68 }; 69 };
69 70
70 } // namespace base 71 } // namespace base
71 72
72 #endif // BASE_PROFILER_NATIVE_STACK_SAMPLER_H_ 73 #endif // BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
73 74
OLDNEW
« no previous file with comments | « base/process/process_win.cc ('k') | base/profiler/native_stack_sampler_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698