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

Unified Diff: base/debug/asan_invalid_access.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/containers/scoped_ptr_hash_map_unittest.cc ('k') | base/debug/close_handle_hook_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/asan_invalid_access.cc
diff --git a/base/debug/asan_invalid_access.cc b/base/debug/asan_invalid_access.cc
index ba0a10bb885a8db87fa768545f0faf280adf586b..ba222ae9f9329c4815f3c5926b7c2f53a45a8797 100644
--- a/base/debug/asan_invalid_access.cc
+++ b/base/debug/asan_invalid_access.cc
@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/debug/asan_invalid_access.h"
+
#include <stddef.h>
+#include <memory>
+
#include "base/debug/alias.h"
-#include "base/debug/asan_invalid_access.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#if defined(OS_WIN)
@@ -61,7 +63,7 @@ static const size_t kArraySize = 5;
void AsanHeapOverflow() {
// Declares the array as volatile to make sure it doesn't get optimized away.
- scoped_ptr<volatile int[]> array(
+ std::unique_ptr<volatile int[]> array(
const_cast<volatile int*>(new int[kArraySize]));
int dummy = array[kArraySize];
base::debug::Alias(&dummy);
@@ -69,7 +71,7 @@ void AsanHeapOverflow() {
void AsanHeapUnderflow() {
// Declares the array as volatile to make sure it doesn't get optimized away.
- scoped_ptr<volatile int[]> array(
+ std::unique_ptr<volatile int[]> array(
const_cast<volatile int*>(new int[kArraySize]));
// We need to store the underflow address in a temporary variable as trying to
// access array[-1] will trigger a warning C4245: "conversion from 'int' to
@@ -81,7 +83,7 @@ void AsanHeapUnderflow() {
void AsanHeapUseAfterFree() {
// Declares the array as volatile to make sure it doesn't get optimized away.
- scoped_ptr<volatile int[]> array(
+ std::unique_ptr<volatile int[]> array(
const_cast<volatile int*>(new int[kArraySize]));
volatile int* dangling = array.get();
array.reset();
« no previous file with comments | « base/containers/scoped_ptr_hash_map_unittest.cc ('k') | base/debug/close_handle_hook_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698