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

Unified Diff: third_party/crashpad/crashpad/util/win/process_info.cc

Issue 1911823002: Convert //third_party from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update crashpad's README.chromium 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
Index: third_party/crashpad/crashpad/util/win/process_info.cc
diff --git a/third_party/crashpad/crashpad/util/win/process_info.cc b/third_party/crashpad/crashpad/util/win/process_info.cc
index 9e47206d5412ec24883c0b489000b9f47db72d84..fc76bb2887b228d7b89de7428a320b09333b0fbb 100644
--- a/third_party/crashpad/crashpad/util/win/process_info.cc
+++ b/third_party/crashpad/crashpad/util/win/process_info.cc
@@ -18,10 +18,10 @@
#include <algorithm>
#include <limits>
+#include <memory>
#include <type_traits>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "util/numeric/safe_assignment.h"
@@ -131,13 +131,13 @@ MEMORY_BASIC_INFORMATION64 MemoryBasicInformationToMemoryBasicInformation64(
// NtQueryObject with a retry for size mismatch as well as a minimum size to
// retrieve (and expect).
-scoped_ptr<uint8_t[]> QueryObject(
+std::unique_ptr<uint8_t[]> QueryObject(
HANDLE handle,
OBJECT_INFORMATION_CLASS object_information_class,
ULONG minimum_size) {
ULONG size = minimum_size;
ULONG return_length;
- scoped_ptr<uint8_t[]> buffer(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[size]);
NTSTATUS status = crashpad::NtQueryObject(
handle, object_information_class, buffer.get(), size, &return_length);
if (status == STATUS_INFO_LENGTH_MISMATCH) {
@@ -347,7 +347,7 @@ bool ReadMemoryInfo(HANDLE process, bool is_64_bit, ProcessInfo* process_info) {
std::vector<ProcessInfo::Handle> ProcessInfo::BuildHandleVector(
HANDLE process) const {
ULONG buffer_size = 2 * 1024 * 1024;
- scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
// Typically if the buffer were too small, STATUS_INFO_LENGTH_MISMATCH would
// return the correct size in the final argument, but it does not for
@@ -409,7 +409,7 @@ std::vector<ProcessInfo::Handle> ProcessInfo::BuildHandleVector(
// information, but include the information that we do have already.
ScopedKernelHANDLE scoped_dup_handle(dup_handle);
- scoped_ptr<uint8_t[]> object_basic_information_buffer =
+ std::unique_ptr<uint8_t[]> object_basic_information_buffer =
QueryObject(dup_handle,
ObjectBasicInformation,
sizeof(PUBLIC_OBJECT_BASIC_INFORMATION));
@@ -435,7 +435,7 @@ std::vector<ProcessInfo::Handle> ProcessInfo::BuildHandleVector(
result_handle.handle_count = object_basic_information->HandleCount - 1;
}
- scoped_ptr<uint8_t[]> object_type_information_buffer =
+ std::unique_ptr<uint8_t[]> object_type_information_buffer =
QueryObject(dup_handle,
ObjectTypeInformation,
sizeof(PUBLIC_OBJECT_TYPE_INFORMATION));
« no previous file with comments | « third_party/crashpad/crashpad/util/win/module_version.cc ('k') | third_party/crashpad/crashpad/util/win/process_info_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698