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

Unified Diff: content/browser/compositor/buffer_queue.cc

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « content/browser/compositor/buffer_queue.h ('k') | content/browser/compositor/buffer_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/buffer_queue.cc
diff --git a/content/browser/compositor/buffer_queue.cc b/content/browser/compositor/buffer_queue.cc
index cafb6d96a18b64448d2cf331b86f67a7a15b4a0a..e5c60b9ca25fa0c2007588f58b9ac98734ce8b89 100644
--- a/content/browser/compositor/buffer_queue.cc
+++ b/content/browser/compositor/buffer_queue.cc
@@ -5,6 +5,7 @@
#include "content/browser/compositor/buffer_queue.h"
#include "base/containers/adapters.h"
+#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "content/browser/compositor/gl_helper.h"
#include "content/browser/compositor/image_transport_factory.h"
@@ -156,12 +157,12 @@ void BufferQueue::RecreateBuffers() {
}
}
-scoped_ptr<BufferQueue::AllocatedSurface> BufferQueue::RecreateBuffer(
- scoped_ptr<AllocatedSurface> surface) {
+std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::RecreateBuffer(
+ std::unique_ptr<AllocatedSurface> surface) {
if (!surface)
return nullptr;
- scoped_ptr<AllocatedSurface> new_surface(GetNextSurface());
+ std::unique_ptr<AllocatedSurface> new_surface(GetNextSurface());
if (!new_surface)
return nullptr;
@@ -204,9 +205,9 @@ void BufferQueue::FreeSurfaceResources(AllocatedSurface* surface) {
allocated_count_--;
}
-scoped_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() {
+std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() {
if (!available_surfaces_.empty()) {
- scoped_ptr<AllocatedSurface> surface =
+ std::unique_ptr<AllocatedSurface> surface =
std::move(available_surfaces_.back());
available_surfaces_.pop_back();
return surface;
@@ -221,7 +222,7 @@ scoped_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() {
// We don't want to allow anything more than triple buffering.
DCHECK_LT(allocated_count_, 4U);
- scoped_ptr<gfx::GpuMemoryBuffer> buffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> buffer(
gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer(
size_, gpu::DefaultBufferFormatForImageFormat(internal_format_),
gfx::BufferUsage::SCANOUT, surface_id_));
@@ -243,13 +244,13 @@ scoped_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() {
allocated_count_++;
gl->BindTexture(texture_target_, texture);
gl->BindTexImage2DCHROMIUM(texture_target_, id);
- return make_scoped_ptr(new AllocatedSurface(this, std::move(buffer), texture,
- id, gfx::Rect(size_)));
+ return base::WrapUnique(new AllocatedSurface(this, std::move(buffer), texture,
+ id, gfx::Rect(size_)));
}
BufferQueue::AllocatedSurface::AllocatedSurface(
BufferQueue* buffer_queue,
- scoped_ptr<gfx::GpuMemoryBuffer> buffer,
+ std::unique_ptr<gfx::GpuMemoryBuffer> buffer,
unsigned int texture,
unsigned int image,
const gfx::Rect& rect)
« no previous file with comments | « content/browser/compositor/buffer_queue.h ('k') | content/browser/compositor/buffer_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698