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

Unified Diff: gpu/command_buffer/common/buffer.h

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master 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: gpu/command_buffer/common/buffer.h
diff --git a/gpu/command_buffer/common/buffer.h b/gpu/command_buffer/common/buffer.h
index 1e427f27dbb0472840185393951e1152ff49d809..0aea591f716bcb7e1ff5455df36348ab0cd1888b 100644
--- a/gpu/command_buffer/common/buffer.h
+++ b/gpu/command_buffer/common/buffer.h
@@ -8,9 +8,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "gpu/gpu_export.h"
@@ -30,7 +31,7 @@ class GPU_EXPORT BufferBacking {
class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking {
public:
- SharedMemoryBufferBacking(scoped_ptr<base::SharedMemory> shared_memory,
+ SharedMemoryBufferBacking(std::unique_ptr<base::SharedMemory> shared_memory,
size_t size);
~SharedMemoryBufferBacking() override;
void* GetMemory() const override;
@@ -38,7 +39,7 @@ class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking {
base::SharedMemory* shared_memory() { return shared_memory_.get(); }
private:
- scoped_ptr<base::SharedMemory> shared_memory_;
+ std::unique_ptr<base::SharedMemory> shared_memory_;
size_t size_;
DISALLOW_COPY_AND_ASSIGN(SharedMemoryBufferBacking);
};
@@ -46,7 +47,7 @@ class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking {
// Buffer owns a piece of shared-memory of a certain size.
class GPU_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> {
public:
- explicit Buffer(scoped_ptr<BufferBacking> backing);
+ explicit Buffer(std::unique_ptr<BufferBacking> backing);
BufferBacking* backing() const { return backing_.get(); }
void* memory() const { return memory_; }
@@ -59,22 +60,22 @@ class GPU_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> {
friend class base::RefCountedThreadSafe<Buffer>;
~Buffer();
- scoped_ptr<BufferBacking> backing_;
+ std::unique_ptr<BufferBacking> backing_;
void* memory_;
size_t size_;
DISALLOW_COPY_AND_ASSIGN(Buffer);
};
-static inline scoped_ptr<BufferBacking> MakeBackingFromSharedMemory(
- scoped_ptr<base::SharedMemory> shared_memory,
+static inline std::unique_ptr<BufferBacking> MakeBackingFromSharedMemory(
+ std::unique_ptr<base::SharedMemory> shared_memory,
size_t size) {
- return scoped_ptr<BufferBacking>(
+ return std::unique_ptr<BufferBacking>(
new SharedMemoryBufferBacking(std::move(shared_memory), size));
}
static inline scoped_refptr<Buffer> MakeBufferFromSharedMemory(
- scoped_ptr<base::SharedMemory> shared_memory,
+ std::unique_ptr<base::SharedMemory> shared_memory,
size_t size) {
return new Buffer(
MakeBackingFromSharedMemory(std::move(shared_memory), size));
« no previous file with comments | « gpu/command_buffer/client/vertex_array_object_manager_unittest.cc ('k') | gpu/command_buffer/common/buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698