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

Unified Diff: base/profiler/native_stack_sampler_win.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/profiler/native_stack_sampler_posix.cc ('k') | base/profiler/stack_sampling_profiler.h » ('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 b234090d0a5850e4357a7c7e99f5420109723acd..063374f19d5b1edfd7d758d98e4047a1b8d67bd6 100644
--- a/base/profiler/native_stack_sampler_win.cc
+++ b/base/profiler/native_stack_sampler_win.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/profiler/native_stack_sampler.h"
+
#include <objbase.h>
#include <windows.h>
#include <stddef.h>
@@ -9,14 +11,13 @@
#include <cstdlib>
#include <map>
+#include <memory>
#include <utility>
#include <vector>
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/profiler/native_stack_sampler.h"
#include "base/profiler/win32_stack_frame_unwinder.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -414,7 +415,7 @@ class NativeStackSamplerWin : public NativeStackSampler {
// Buffer to use for copies of the stack. We use the same buffer for all the
// samples to avoid the overhead of multiple allocations and frees.
- const scoped_ptr<unsigned char[]> stack_copy_buffer_;
+ const std::unique_ptr<unsigned char[]> stack_copy_buffer_;
// Weak. Points to the modules associated with the profile being recorded
// between ProfileRecordingStarting() and ProfileRecordingStopped().
@@ -519,7 +520,7 @@ void NativeStackSamplerWin::CopyToSample(
} // namespace
-scoped_ptr<NativeStackSampler> NativeStackSampler::Create(
+std::unique_ptr<NativeStackSampler> NativeStackSampler::Create(
PlatformThreadId thread_id,
NativeStackSamplerTestDelegate* test_delegate) {
#if _WIN64
@@ -530,12 +531,11 @@ scoped_ptr<NativeStackSampler> NativeStackSampler::Create(
thread_id);
if (thread_handle) {
- return scoped_ptr<NativeStackSampler>(new NativeStackSamplerWin(
- win::ScopedHandle(thread_handle),
- test_delegate));
+ return std::unique_ptr<NativeStackSampler>(new NativeStackSamplerWin(
+ win::ScopedHandle(thread_handle), test_delegate));
}
#endif
- return scoped_ptr<NativeStackSampler>();
+ return std::unique_ptr<NativeStackSampler>();
}
} // namespace base
« no previous file with comments | « base/profiler/native_stack_sampler_posix.cc ('k') | base/profiler/stack_sampling_profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698