convert //gpu to std::unique_ptr
BUG=554298
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel
[email protected]
Review URL: https://codereview.chromium.org/1859703002
Cr-Commit-Position: refs/heads/master@{#388176}
diff --git a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
index 4aae7d9..d94f15fb 100644
--- a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
+++ b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
diff --git a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h
index cbd5552..997e242 100644
--- a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h
+++ b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@
#ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_GPU_MEMORY_BUFFER_MANAGER_H_
#define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_GPU_MEMORY_BUFFER_MANAGER_H_
+#include <memory>
+
#include "base/macros.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/cc/surfaces/surface_display_output_surface_unittest.cc b/cc/surfaces/surface_display_output_surface_unittest.cc
index 8315130..f263363 100644
--- a/cc/surfaces/surface_display_output_surface_unittest.cc
+++ b/cc/surfaces/surface_display_output_surface_unittest.cc
@@ -4,6 +4,8 @@
#include "cc/surfaces/surface_display_output_surface.h"
+#include <memory>
+
#include "cc/surfaces/onscreen_display_client.h"
#include "cc/surfaces/surface_id_allocator.h"
#include "cc/surfaces/surface_manager.h"
@@ -115,7 +117,7 @@
protected:
std::unique_ptr<base::SimpleTestTickClock> now_src_;
scoped_refptr<OrderedSimpleTaskRunner> task_runner_;
- scoped_ptr<BackToBackBeginFrameSource> begin_frame_source_;
+ std::unique_ptr<BackToBackBeginFrameSource> begin_frame_source_;
SurfaceIdAllocator allocator_;
const gfx::Size display_size_;
diff --git a/cc/test/test_gpu_memory_buffer_manager.h b/cc/test/test_gpu_memory_buffer_manager.h
index ac805b8..e5c70ec 100644
--- a/cc/test/test_gpu_memory_buffer_manager.h
+++ b/cc/test/test_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@
#ifndef CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
#define CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
+#include <memory>
+
#include "base/macros.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/cc/test/test_in_process_context_provider.h b/cc/test/test_in_process_context_provider.h
index 3e5bd25..5062909 100644
--- a/cc/test/test_in_process_context_provider.h
+++ b/cc/test/test_in_process_context_provider.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/synchronization/lock.h"
#include "cc/output/context_provider.h"
#include "cc/test/test_gpu_memory_buffer_manager.h"
diff --git a/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc b/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc
index 08d9a38..6fe0ef00 100644
--- a/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc
+++ b/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc
@@ -13,7 +13,7 @@
MojoGpuMemoryBufferManager::~MojoGpuMemoryBufferManager() {}
-scoped_ptr<gfx::GpuMemoryBuffer>
+std::unique_ptr<gfx::GpuMemoryBuffer>
MojoGpuMemoryBufferManager::AllocateGpuMemoryBuffer(const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
@@ -21,7 +21,7 @@
return MojoGpuMemoryBufferImpl::Create(size, format, usage);
}
-scoped_ptr<gfx::GpuMemoryBuffer>
+std::unique_ptr<gfx::GpuMemoryBuffer>
MojoGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
diff --git a/components/mus/gles2/mojo_gpu_memory_buffer_manager.h b/components/mus/gles2/mojo_gpu_memory_buffer_manager.h
index d7aae7be..d8b2287 100644
--- a/components/mus/gles2/mojo_gpu_memory_buffer_manager.h
+++ b/components/mus/gles2/mojo_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@
#ifndef COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_
#define COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_
+#include <memory>
+
#include "base/macros.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
@@ -16,12 +18,12 @@
~MojoGpuMemoryBufferManager() override;
// Overridden from gpu::GpuMemoryBufferManager:
- scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
int32_t surface_id) override;
- scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
+ std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format) override;
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.h b/content/browser/compositor/gpu_browser_compositor_output_surface.h
index fe2dd8b..f8c2a7d 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.h
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
+#include <memory>
+
#include "base/cancelable_callback.h"
#include "base/macros.h"
#include "build/build_config.h"
diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h
index 7b428a3..46b4a73 100644
--- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h
+++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#define CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
+#include <memory>
+
#include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
namespace gpu {
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.h b/content/browser/gpu/browser_gpu_memory_buffer_manager.h
index e41b3e5..da6e335 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.h
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <utility>
#include "base/callback.h"
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc
index e217e31..bc68ed1f 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <memory>
#include <string>
#include <utility>
diff --git a/content/child/child_gpu_memory_buffer_manager.cc b/content/child/child_gpu_memory_buffer_manager.cc
index c636b508..36235ab 100644
--- a/content/child/child_gpu_memory_buffer_manager.cc
+++ b/content/child/child_gpu_memory_buffer_manager.cc
@@ -4,6 +4,7 @@
#include "content/child/child_gpu_memory_buffer_manager.h"
+#include <memory>
#include <utility>
#include "content/common/child_process_messages.h"
diff --git a/content/child/child_gpu_memory_buffer_manager.h b/content/child/child_gpu_memory_buffer_manager.h
index 97801f3..797aedb 100644
--- a/content/child/child_gpu_memory_buffer_manager.h
+++ b/content/child/child_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_
#define CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_
+#include <memory>
+
#include "base/macros.h"
#include "content/child/thread_safe_sender.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
index 4ef4e17..e1712f5 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -5,6 +5,8 @@
#include "content/common/gpu/client/context_provider_command_buffer.h"
#include <stddef.h>
+
+#include <memory>
#include <set>
#include <utility>
#include <vector>
diff --git a/content/common/gpu/client/gpu_in_process_context_tests.cc b/content/common/gpu/client/gpu_in_process_context_tests.cc
index 933466d..31a5e0cf 100644
--- a/content/common/gpu/client/gpu_in_process_context_tests.cc
+++ b/content/common/gpu/client/gpu_in_process_context_tests.cc
@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include <stdio.h>
+
#include <cmath>
+#include <memory>
#include <string>
#include <vector>
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index 48ab90c1..c9c4cf1 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -12,6 +12,7 @@
#include <algorithm>
#include <map>
+#include <memory>
#include "base/atomicops.h"
#include "base/bind.h"
diff --git a/content/common/gpu/media/android_copying_backing_strategy.h b/content/common/gpu/media/android_copying_backing_strategy.h
index 83b6c4a..59273d9 100644
--- a/content/common/gpu/media/android_copying_backing_strategy.h
+++ b/content/common/gpu/media/android_copying_backing_strategy.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "content/common/content_export.h"
#include "content/common/gpu/media/android_video_decode_accelerator.h"
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
index 00f4c3a..2c062af 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/android/build_info.h"
#include "base/auto_reset.h"
#include "base/bind.h"
diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h
index 6728270..6bbe4db 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.h
+++ b/content/common/gpu/media/android_video_decode_accelerator.h
@@ -9,6 +9,7 @@
#include <list>
#include <map>
+#include <memory>
#include <queue>
#include <string>
#include <vector>
diff --git a/content/common/gpu/media/android_video_encode_accelerator.cc b/content/common/gpu/media/android_video_encode_accelerator.cc
index accaa501..9a636b9 100644
--- a/content/common/gpu/media/android_video_encode_accelerator.cc
+++ b/content/common/gpu/media/android_video_encode_accelerator.cc
@@ -4,6 +4,7 @@
#include "content/common/gpu/media/android_video_encode_accelerator.h"
+#include <memory>
#include <set>
#include "base/bind.h"
diff --git a/content/common/gpu/media/android_video_encode_accelerator.h b/content/common/gpu/media/android_video_encode_accelerator.h
index a708872..025814a7 100644
--- a/content/common/gpu/media/android_video_encode_accelerator.h
+++ b/content/common/gpu/media/android_video_encode_accelerator.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <list>
+#include <memory>
#include <queue>
#include <vector>
diff --git a/content/common/gpu/media/avda_codec_image.cc b/content/common/gpu/media/avda_codec_image.cc
index 667ab31..cd9ec57b 100644
--- a/content/common/gpu/media/avda_codec_image.cc
+++ b/content/common/gpu/media/avda_codec_image.cc
@@ -6,6 +6,8 @@
#include <string.h>
+#include <memory>
+
#include "base/metrics/histogram_macros.h"
#include "content/common/gpu/media/avda_shared_state.h"
#include "gpu/command_buffer/service/context_group.h"
diff --git a/content/common/gpu/media/avda_codec_image.h b/content/common/gpu/media/avda_codec_image.h
index 8adb5fb..9c8c7f6 100644
--- a/content/common/gpu/media/avda_codec_image.h
+++ b/content/common/gpu/media/avda_codec_image.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "content/common/gpu/media/avda_shared_state.h"
#include "gpu/command_buffer/service/gl_stream_texture_image.h"
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.h b/content/common/gpu/media/dxva_video_decode_accelerator_win.h
index 2d936ac..10ad585b 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator_win.h
+++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.h
@@ -9,6 +9,7 @@
#include <d3d9.h>
#include <initguid.h>
#include <stdint.h>
+
// Work around bug in this header by disabling the relevant warning for it.
// https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h-in-win8-sdk-triggers-c4201-with-w4
#pragma warning(push)
@@ -19,6 +20,7 @@
#include <list>
#include <map>
+#include <memory>
#include <vector>
#include "base/compiler_specific.h"
diff --git a/content/common/gpu/media/fake_video_decode_accelerator.cc b/content/common/gpu/media/fake_video_decode_accelerator.cc
index f811162..cb59425 100644
--- a/content/common/gpu/media/fake_video_decode_accelerator.cc
+++ b/content/common/gpu/media/fake_video_decode_accelerator.cc
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <string.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/thread_task_runner_handle.h"
diff --git a/content/common/gpu/media/generic_v4l2_device.cc b/content/common/gpu/media/generic_v4l2_device.cc
index 0f55337..df64a4b 100644
--- a/content/common/gpu/media/generic_v4l2_device.cc
+++ b/content/common/gpu/media/generic_v4l2_device.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
//
+#include "content/common/gpu/media/generic_v4l2_device.h"
+
#include <errno.h>
#include <fcntl.h>
#include <libdrm/drm_fourcc.h>
@@ -13,12 +15,13 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <memory>
+
#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
-#include "content/common/gpu/media/generic_v4l2_device.h"
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_bindings.h"
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
index 6bf6ae4..0078317 100644
--- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
@@ -5,6 +5,8 @@
#include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
#include <stdint.h>
+
+#include <memory>
#include <utility>
#include "base/bind.h"
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.h b/content/common/gpu/media/gpu_jpeg_decode_accelerator.h
index 486fdf4a..a2ac643 100644
--- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.h
+++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index 160d0c3..a7c2189 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -4,6 +4,7 @@
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
+#include <memory>
#include <vector>
#include "base/bind.h"
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.h b/content/common/gpu/media/gpu_video_decode_accelerator.h
index 561ca34..2f338d8 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.h
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <vector>
#include "base/compiler_specific.h"
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h b/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h
index 26990778..ea4c58c 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h
+++ b/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_
#define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_
+#include <memory>
+
#include "base/callback.h"
#include "base/threading/thread_checker.h"
#include "content/common/content_export.h"
diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc b/content/common/gpu/media/gpu_video_encode_accelerator.cc
index eab2f941..6381658 100644
--- a/content/common/gpu/media/gpu_video_encode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc
@@ -4,6 +4,8 @@
#include "content/common/gpu/media/gpu_video_encode_accelerator.h"
+#include <memory>
+
#include "base/callback.h"
#include "base/command_line.h"
#include "base/logging.h"
diff --git a/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc b/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
index 53bc5d1..d872321 100644
--- a/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
@@ -10,6 +10,8 @@
#include <stdint.h>
#include <string.h>
+#include <memory>
+
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
diff --git a/content/common/gpu/media/media_channel.h b/content/common/gpu/media/media_channel.h
index 7f0bca8..49c1ee7 100644
--- a/content/common/gpu/media/media_channel.h
+++ b/content/common/gpu/media/media_channel.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_COMMON_GPU_MEDIA_MEDIA_CHANNEL_H_
#define CONTENT_COMMON_GPU_MEDIA_MEDIA_CHANNEL_H_
+#include <memory>
+
#include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
diff --git a/content/common/gpu/media/media_service.cc b/content/common/gpu/media/media_service.cc
index b274589b..1fbd51e 100644
--- a/content/common/gpu/media/media_service.cc
+++ b/content/common/gpu/media/media_service.cc
@@ -4,6 +4,7 @@
#include "content/common/gpu/media/media_service.h"
+#include <memory>
#include <utility>
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
diff --git a/content/common/gpu/media/media_service.h b/content/common/gpu/media/media_service.h
index eaa01e3f..0d8d6499 100644
--- a/content/common/gpu/media/media_service.h
+++ b/content/common/gpu/media/media_service.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "ipc/ipc_listener.h"
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc
index 86e4e37..7923880 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -7,6 +7,7 @@
#include <string.h>
#include <algorithm>
+#include <memory>
#include <numeric>
#include <vector>
diff --git a/content/common/gpu/media/rendering_helper.h b/content/common/gpu/media/rendering_helper.h
index 6a43b39..1fc592e 100644
--- a/content/common/gpu/media/rendering_helper.h
+++ b/content/common/gpu/media/rendering_helper.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <queue>
#include <vector>
diff --git a/content/common/gpu/media/v4l2_image_processor.cc b/content/common/gpu/media/v4l2_image_processor.cc
index 41ab883..ca56c8b 100644
--- a/content/common/gpu/media/v4l2_image_processor.cc
+++ b/content/common/gpu/media/v4l2_image_processor.cc
@@ -11,6 +11,8 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
diff --git a/content/common/gpu/media/v4l2_image_processor.h b/content/common/gpu/media/v4l2_image_processor.h
index 3457f38d..2b40f3c 100644
--- a/content/common/gpu/media/v4l2_image_processor.h
+++ b/content/common/gpu/media/v4l2_image_processor.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <queue>
#include <vector>
diff --git a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc
index c563afc..7af2759 100644
--- a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc
@@ -2,15 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h"
+
#include <errno.h>
#include <linux/videodev2.h>
#include <string.h>
#include <sys/mman.h>
+#include <memory>
+
#include "base/big_endian.h"
#include "base/bind.h"
#include "base/thread_task_runner_handle.h"
-#include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h"
#include "media/filters/jpeg_parser.h"
#include "third_party/libyuv/include/libyuv.h"
diff --git a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h
index a7e0f65..da61120 100644
--- a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h
+++ b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <queue>
#include <vector>
diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
index 2cca61f1..57550a3 100644
--- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.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 "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h"
+
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
@@ -11,6 +13,8 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -21,7 +25,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "content/common/gpu/media/shared_memory_region.h"
-#include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/media_switches.h"
#include "ui/gl/gl_context.h"
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
index fe0343f..a210d3b 100644
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.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 "content/common/gpu/media/v4l2_video_decode_accelerator.h"
+
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
@@ -12,6 +14,8 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/macros.h"
@@ -21,7 +25,6 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "content/common/gpu/media/shared_memory_region.h"
-#include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
#include "media/base/media_switches.h"
#include "media/filters/h264_parser.h"
#include "ui/gfx/geometry/rect.h"
diff --git a/content/common/gpu/media/v4l2_video_encode_accelerator.cc b/content/common/gpu/media/v4l2_video_encode_accelerator.cc
index c0437e4..20cdd358 100644
--- a/content/common/gpu/media/v4l2_video_encode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_encode_accelerator.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 "content/common/gpu/media/v4l2_video_encode_accelerator.h"
+
#include <fcntl.h>
#include <linux/videodev2.h>
#include <poll.h>
@@ -9,6 +11,8 @@
#include <sys/eventfd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+
+#include <memory>
#include <utility>
#include "base/callback.h"
@@ -18,7 +22,6 @@
#include "base/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
#include "content/common/gpu/media/shared_memory_region.h"
-#include "content/common/gpu/media/v4l2_video_encode_accelerator.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/bitstream_buffer.h"
diff --git a/content/common/gpu/media/v4l2_video_encode_accelerator.h b/content/common/gpu/media/v4l2_video_encode_accelerator.h
index f1f6a3c..e49a5ee 100644
--- a/content/common/gpu/media/v4l2_video_encode_accelerator.h
+++ b/content/common/gpu/media/v4l2_video_encode_accelerator.h
@@ -8,7 +8,9 @@
#include <linux/videodev2.h>
#include <stddef.h>
#include <stdint.h>
+
#include <list>
+#include <memory>
#include <vector>
#include "base/files/scoped_file.h"
diff --git a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc
index 64931f6f..fc25553 100644
--- a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
#include <string.h>
+
+#include <memory>
#include <utility>
#include "base/bind.h"
diff --git a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h
index 6493c42..eaf54e86 100644
--- a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h
+++ b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index bcd89d1..f41cf57 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -6,6 +6,8 @@
#include <string.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/logging.h"
#include "base/macros.h"
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.h b/content/common/gpu/media/vaapi_video_decode_accelerator.h
index 5f95629..9f2b66b 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.h
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.h
@@ -13,6 +13,7 @@
#include <list>
#include <map>
+#include <memory>
#include <queue>
#include <utility>
#include <vector>
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.cc b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
index 86e6676..dfa7f9f 100644
--- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
@@ -5,6 +5,8 @@
#include "content/common/gpu/media/vaapi_video_encode_accelerator.h"
#include <string.h>
+
+#include <memory>
#include <utility>
#include "base/bind.h"
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.h b/content/common/gpu/media/vaapi_video_encode_accelerator.h
index 8cb709640..8a4c88c 100644
--- a/content/common/gpu/media/vaapi_video_encode_accelerator.h
+++ b/content/common/gpu/media/vaapi_video_encode_accelerator.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <list>
+#include <memory>
#include <queue>
#include "base/macros.h"
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index 743b660..a607071 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -19,9 +19,11 @@
#include <stdint.h>
#include <sys/stat.h>
#include <sys/types.h>
+
#include <algorithm>
#include <deque>
#include <map>
+#include <memory>
#include <utility>
#include "base/at_exit.h"
diff --git a/content/common/gpu/media/video_encode_accelerator_unittest.cc b/content/common/gpu/media/video_encode_accelerator_unittest.cc
index df5ad4f..3f3f9ef 100644
--- a/content/common/gpu/media/video_encode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc
@@ -5,7 +5,9 @@
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
+
#include <algorithm>
+#include <memory>
#include <queue>
#include <string>
#include <utility>
diff --git a/content/common/gpu/media/vp9_decoder.cc b/content/common/gpu/media/vp9_decoder.cc
index 1cb0dff..cba92fd 100644
--- a/content/common/gpu/media/vp9_decoder.cc
+++ b/content/common/gpu/media/vp9_decoder.cc
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
#include "content/common/gpu/media/vp9_decoder.h"
+
+#include <memory>
+
+#include "base/logging.h"
#include "media/base/limits.h"
namespace content {
diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
index c29a467..1942577 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
@@ -10,6 +10,7 @@
#include <stddef.h>
#include <algorithm>
+#include <memory>
#include "base/bind.h"
#include "base/logging.h"
diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.h b/content/common/gpu/media/vt_video_decode_accelerator_mac.h
index 932a6523..33440ba 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator_mac.h
+++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <queue>
#include "base/mac/scoped_cftyperef.h"
diff --git a/content/common/gpu/media/vt_video_encode_accelerator_mac.cc b/content/common/gpu/media/vt_video_encode_accelerator_mac.cc
index f22db09..d48b92d 100644
--- a/content/common/gpu/media/vt_video_encode_accelerator_mac.cc
+++ b/content/common/gpu/media/vt_video_encode_accelerator_mac.cc
@@ -4,6 +4,8 @@
#include "content/common/gpu/media/vt_video_encode_accelerator_mac.h"
+#include <memory>
+
#include "base/thread_task_runner_handle.h"
#include "media/base/mac/coremedia_glue.h"
#include "media/base/mac/corevideo_glue.h"
diff --git a/content/common/gpu/media/vt_video_encode_accelerator_mac.h b/content/common/gpu/media/vt_video_encode_accelerator_mac.h
index adb2584..dfa180e 100644
--- a/content/common/gpu/media/vt_video_encode_accelerator_mac.h
+++ b/content/common/gpu/media/vt_video_encode_accelerator_mac.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_ENCODE_ACCELERATOR_MAC_H_
#define CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_ENCODE_ACCELERATOR_MAC_H_
+#include <memory>
+
#include "base/mac/scoped_cftyperef.h"
#include "content/common/content_export.h"
#include "media/base/mac/videotoolbox_glue.h"
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 3dfba0c..7ffa59e 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -5,6 +5,7 @@
#include <stddef.h>
#include <stdlib.h>
+#include <memory>
#include <utility>
#include "base/lazy_instance.h"
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h
index d425af1..7e07884 100644
--- a/content/public/browser/android/synchronous_compositor.h
+++ b/content/public/browser/android/synchronous_compositor.h
@@ -7,6 +7,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "gpu/command_buffer/service/in_process_command_buffer.h"
diff --git a/content/public/gpu/gpu_video_decode_accelerator_factory.h b/content/public/gpu/gpu_video_decode_accelerator_factory.h
index 6dff49f..ea740e24 100644
--- a/content/public/gpu/gpu_video_decode_accelerator_factory.h
+++ b/content/public/gpu/gpu_video_decode_accelerator_factory.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_
#define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_
+#include <memory>
+
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.h b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
index a1f1e39..a2dcb1a5 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.h
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <vector>
#include "base/macros.h"
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h
index 9d5ed054..b356b50 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.h
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "base/memory/shared_memory.h"
#include "base/memory/weak_ptr.h"
diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h
index bd2c45f8..ee8ff72 100644
--- a/gpu/blink/webgraphicscontext3d_impl.h
+++ b/gpu/blink/webgraphicscontext3d_impl.h
@@ -7,11 +7,11 @@
#include <stdint.h>
+#include <memory>
#include <string>
#include <vector>
#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/blink/gpu_blink_export.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/WebKit/public/platform/WebString.h"
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index d207979..d7c784f9 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -6161,7 +6161,7 @@
return error::kInvalidArguments;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
gl%(func_name)s(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
group_->Add%(resource_name)sId(%(last_arg_name)s[ii], service_ids[ii]);
@@ -10936,6 +10936,8 @@
comment = ("// This file is included by gles2_interface.h to declare the\n"
"// GL api functions.\n")
code = """
+#include <memory>
+
#include "gpu/command_buffer/client/gles2_interface.h"
#include "mojo/public/c/gles2/gles2.h"
diff --git a/gpu/command_buffer/client/buffer_tracker_unittest.cc b/gpu/command_buffer/client/buffer_tracker_unittest.cc
index c44d384..b8d2a7d 100644
--- a/gpu/command_buffer/client/buffer_tracker_unittest.cc
+++ b/gpu/command_buffer/client/buffer_tracker_unittest.cc
@@ -10,7 +10,9 @@
#include <GLES2/gl2ext.h>
#include <stddef.h>
#include <stdint.h>
-#include "base/memory/scoped_ptr.h"
+
+#include <memory>
+
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/mapped_memory.h"
@@ -67,10 +69,10 @@
command_buffer_.reset();
}
- scoped_ptr<MockClientCommandBufferImpl> command_buffer_;
- scoped_ptr<GLES2CmdHelper> helper_;
- scoped_ptr<MappedMemoryManager> mapped_memory_;
- scoped_ptr<BufferTracker> buffer_tracker_;
+ std::unique_ptr<MockClientCommandBufferImpl> command_buffer_;
+ std::unique_ptr<GLES2CmdHelper> helper_;
+ std::unique_ptr<MappedMemoryManager> mapped_memory_;
+ std::unique_ptr<BufferTracker> buffer_tracker_;
};
TEST_F(BufferTrackerTest, Basic) {
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc
index 3e8c43c8..d442a88 100644
--- a/gpu/command_buffer/client/client_test_helper.cc
+++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -9,6 +9,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -72,7 +74,7 @@
*id = GetNextFreeTransferBufferId();
if (*id >= 0) {
int32_t ndx = *id - kTransferBufferBaseId;
- scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(size);
transfer_buffer_buffers_[ndx] =
MakeBufferFromSharedMemory(std::move(shared_memory), size);
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h
index 95582d55..b3809af 100644
--- a/gpu/command_buffer/client/client_test_helper.h
+++ b/gpu/command_buffer/client/client_test_helper.h
@@ -10,9 +10,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/gpu_memory_allocation.h"
diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
index 2fea6ba..b569990 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <list>
+#include <memory>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -258,11 +259,11 @@
CommandBufferOffset get_helper_put() { return helper_->put_; }
- scoped_ptr<AsyncAPIMock> api_mock_;
+ std::unique_ptr<AsyncAPIMock> api_mock_;
scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<CommandBufferServiceLocked> command_buffer_;
- scoped_ptr<CommandExecutor> executor_;
- scoped_ptr<CommandBufferHelper> helper_;
+ std::unique_ptr<CommandBufferServiceLocked> command_buffer_;
+ std::unique_ptr<CommandExecutor> executor_;
+ std::unique_ptr<CommandBufferHelper> helper_;
std::list<linked_ptr<std::vector<CommandBufferEntry> > > test_command_args_;
unsigned int test_command_next_id_;
Sequence sequence_;
diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc
index 6abe1ba..7b3a6ec 100644
--- a/gpu/command_buffer/client/fenced_allocator_test.cc
+++ b/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -6,6 +6,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/memory/aligned_memory.h"
@@ -69,11 +71,11 @@
int32_t GetToken() { return command_buffer_->GetLastState().token; }
- scoped_ptr<AsyncAPIMock> api_mock_;
+ std::unique_ptr<AsyncAPIMock> api_mock_;
scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<CommandBufferService> command_buffer_;
- scoped_ptr<CommandExecutor> executor_;
- scoped_ptr<CommandBufferHelper> helper_;
+ std::unique_ptr<CommandBufferService> command_buffer_;
+ std::unique_ptr<CommandExecutor> executor_;
+ std::unique_ptr<CommandBufferHelper> helper_;
base::MessageLoop message_loop_;
};
@@ -101,7 +103,7 @@
BaseFencedAllocatorTest::TearDown();
}
- scoped_ptr<FencedAllocator> allocator_;
+ std::unique_ptr<FencedAllocator> allocator_;
};
// Checks basic alloc and free.
@@ -413,8 +415,8 @@
BaseFencedAllocatorTest::TearDown();
}
- scoped_ptr<FencedAllocatorWrapper> allocator_;
- scoped_ptr<char, base::AlignedFreeDeleter> buffer_;
+ std::unique_ptr<FencedAllocatorWrapper> allocator_;
+ std::unique_ptr<char, base::AlignedFreeDeleter> buffer_;
};
// Checks basic alloc and free.
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index 6f2fb0d..74a7d59 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <set>
#include <utility>
#include <vector>
@@ -23,7 +24,6 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
@@ -75,10 +75,10 @@
void Destroy();
void OnSignalSyncPoint(const base::Closure& callback);
- scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_;
- scoped_ptr<TransferBuffer> transfer_buffer_;
- scoped_ptr<gles2::GLES2Implementation> gles2_implementation_;
- scoped_ptr<InProcessCommandBuffer> command_buffer_;
+ std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_;
+ std::unique_ptr<TransferBuffer> transfer_buffer_;
+ std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_;
+ std::unique_ptr<InProcessCommandBuffer> command_buffer_;
const GLInProcessContextSharedMemoryLimits mem_limits_;
@@ -230,7 +230,7 @@
DCHECK_EQ(gfx::kNullAcceleratedWidget, window);
}
- scoped_ptr<GLInProcessContextImpl> context(
+ std::unique_ptr<GLInProcessContextImpl> context(
new GLInProcessContextImpl(memory_limits));
if (!context->Initialize(surface,
is_offscreen,
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 41ec693..059e87d4f 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -10,6 +10,7 @@
#include <list>
#include <map>
+#include <memory>
#include <queue>
#include <set>
#include <string>
@@ -18,7 +19,6 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/trace_event/memory_dump_provider.h"
#include "gpu/command_buffer/client/buffer_tracker.h"
@@ -747,7 +747,7 @@
// unpack skip images as last set by glPixelStorei
GLint unpack_skip_images_;
- scoped_ptr<TextureUnit[]> texture_units_;
+ std::unique_ptr<TextureUnit[]> texture_units_;
// 0 to gl_state_.max_combined_texture_image_units.
GLuint active_texture_unit_;
@@ -774,7 +774,7 @@
// Client side management for vertex array objects. Needed to correctly
// track client side arrays.
- scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_;
+ std::unique_ptr<VertexArrayObjectManager> vertex_array_object_manager_;
GLuint reserved_ids_[2];
@@ -816,15 +816,15 @@
typedef std::map<const void*, MappedTexture> MappedTextureMap;
MappedTextureMap mapped_textures_;
- scoped_ptr<MappedMemoryManager> mapped_memory_;
+ std::unique_ptr<MappedMemoryManager> mapped_memory_;
scoped_refptr<ShareGroup> share_group_;
ShareGroupContextData share_group_context_data_;
- scoped_ptr<QueryTracker> query_tracker_;
- scoped_ptr<IdAllocator> query_id_allocator_;
+ std::unique_ptr<QueryTracker> query_tracker_;
+ std::unique_ptr<IdAllocator> query_id_allocator_;
- scoped_ptr<BufferTracker> buffer_tracker_;
+ std::unique_ptr<BufferTracker> buffer_tracker_;
base::Callback<void(const char*, int32_t)> error_message_callback_;
base::Closure lost_context_callback_;
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 7eb2b0c..9f6a376a 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -10,8 +10,12 @@
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <GLES3/gl3.h>
+
#include <stddef.h>
#include <stdint.h>
+
+#include <memory>
+
#include "base/compiler_specific.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
@@ -535,11 +539,11 @@
memset(ring_buffer->memory(), kInitialValue, ring_buffer->size());
}
- scoped_ptr<MockClientCommandBuffer> command_buffer_;
- scoped_ptr<MockClientGpuControl> gpu_control_;
- scoped_ptr<GLES2CmdHelper> helper_;
- scoped_ptr<MockTransferBuffer> transfer_buffer_;
- scoped_ptr<GLES2Implementation> gl_;
+ std::unique_ptr<MockClientCommandBuffer> command_buffer_;
+ std::unique_ptr<MockClientGpuControl> gpu_control_;
+ std::unique_ptr<GLES2CmdHelper> helper_;
+ std::unique_ptr<MockTransferBuffer> transfer_buffer_;
+ std::unique_ptr<GLES2Implementation> gl_;
CommandBufferEntry* commands_;
int token_;
};
@@ -863,7 +867,7 @@
const uint32_t kBucketId = GLES2Implementation::kResultBucketId;
const uint32_t kTestSize = MaxTransferBufferSize() + 32;
- scoped_ptr<uint8_t[]> buf(new uint8_t[kTestSize]);
+ std::unique_ptr<uint8_t[]> buf(new uint8_t[kTestSize]);
uint8_t* expected_data = buf.get();
for (uint32_t ii = 0; ii < kTestSize; ++ii) {
expected_data[ii] = ii * 3;
@@ -1730,7 +1734,8 @@
0, kHeight / 2, kWidth, kHeight / 2, kFormat, kType,
mem2.id, mem2.offset, result2.id, result2.offset, false);
expected.set_token2.Init(GetNextToken());
- scoped_ptr<int8_t[]> buffer(new int8_t[kWidth * kHeight * kBytesPerPixel]);
+ std::unique_ptr<int8_t[]> buffer(
+ new int8_t[kWidth * kHeight * kBytesPerPixel]);
EXPECT_CALL(*command_buffer(), OnFlush())
.WillOnce(SetMemory(result1.ptr, static_cast<uint32_t>(1)))
@@ -1762,7 +1767,8 @@
0, 0, kWidth, kHeight, kFormat, kType,
mem1.id, mem1.offset, result1.id, result1.offset, false);
expected.set_token.Init(GetNextToken());
- scoped_ptr<int8_t[]> buffer(new int8_t[kWidth * kHeight * kBytesPerPixel]);
+ std::unique_ptr<int8_t[]> buffer(
+ new int8_t[kWidth * kHeight * kBytesPerPixel]);
EXPECT_CALL(*command_buffer(), OnFlush())
.Times(1)
@@ -2432,7 +2438,7 @@
kWidth, kHeight, 1, kFormat, kType, kPixelStoreUnpackAlignment,
&size, &unpadded_row_size, &padded_row_size));
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
for (uint32_t ii = 0; ii < size; ++ii) {
pixels[ii] = static_cast<uint8_t>(ii);
}
@@ -2488,7 +2494,7 @@
kWidth, kHeight / 2, 1, kFormat, kType, kPixelStoreUnpackAlignment,
&half_size, NULL, NULL));
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
for (uint32_t ii = 0; ii < size; ++ii) {
pixels[ii] = static_cast<uint8_t>(ii);
}
@@ -2569,7 +2575,7 @@
ASSERT_TRUE(GLES2Util::ComputeImageDataSizesES3(
kSrcWidth, kSrcSubImageY1, 1, kFormat, kType,
pixel_params, &pixel_size, nullptr, nullptr, nullptr, nullptr));
- scoped_ptr<uint8_t[]> src_pixels;
+ std::unique_ptr<uint8_t[]> src_pixels;
src_pixels.reset(new uint8_t[pixel_size]);
for (size_t i = 0; i < pixel_size; ++i) {
src_pixels[i] = static_cast<uint8_t>(i % 255);
@@ -2710,7 +2716,7 @@
ASSERT_TRUE(GLES2Util::ComputeImageDataSizesES3(
kSrcWidth, kSrcSubImageY1, kSrcSubImageZ1, kFormat, kType,
pixel_params, &pixel_size, nullptr, nullptr, nullptr, nullptr));
- scoped_ptr<uint8_t[]> src_pixels;
+ std::unique_ptr<uint8_t[]> src_pixels;
src_pixels.reset(new uint8_t[pixel_size]);
for (size_t i = 0; i < pixel_size; ++i) {
src_pixels[i] = static_cast<uint8_t>(i % 255);
@@ -2925,7 +2931,7 @@
kWidth, kHeight, kDepth, kFormat, kType, kPixelStoreUnpackAlignment,
&size, NULL, NULL));
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
for (uint32_t ii = 0; ii < size; ++ii) {
pixels[ii] = static_cast<uint8_t>(ii);
}
@@ -2978,7 +2984,7 @@
kWidth, kHeight, kDepth, kFormat, kType, kPixelStoreUnpackAlignment,
&size, NULL, NULL));
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
for (uint32_t ii = 0; ii < size; ++ii) {
pixels[ii] = static_cast<uint8_t>(ii);
}
@@ -3035,7 +3041,7 @@
EXPECT_EQ(size, first_size + second_size);
ExpectedMemoryInfo mem1 = GetExpectedMemory(first_size);
ExpectedMemoryInfo mem2 = GetExpectedMemory(second_size);
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
for (uint32_t ii = 0; ii < size; ++ii) {
pixels[ii] = static_cast<uint8_t>(ii);
}
@@ -3095,7 +3101,7 @@
uint32_t fourth_size = second_size - (padded_row_size - unpadded_row_size);
EXPECT_EQ(size, first_size + second_size + third_size + fourth_size);
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
for (uint32_t ii = 0; ii < size; ++ii) {
pixels[ii] = static_cast<uint8_t>(ii);
}
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_manager.h b/gpu/command_buffer/client/gpu_memory_buffer_manager.h
index a3385325..ba170ca 100644
--- a/gpu/command_buffer/client/gpu_memory_buffer_manager.h
+++ b/gpu/command_buffer/client/gpu_memory_buffer_manager.h
@@ -5,7 +5,8 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
#define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/gpu_export.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_memory_buffer.h"
@@ -19,14 +20,14 @@
GpuMemoryBufferManager();
// Allocates a GpuMemoryBuffer that can be shared with another process.
- virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
+ virtual std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
int32_t surface_id) = 0;
// Creates a GpuMemoryBuffer from existing handle.
- virtual scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
+ virtual std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format) = 0;
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index c40278e..cd1ff41f 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -12,6 +12,7 @@
#include "base/atomic_sequence_num.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
@@ -120,7 +121,7 @@
DCHECK(shm.get());
MemoryChunk* mc = new MemoryChunk(id, shm, helper_);
allocated_memory_ += mc->GetSize();
- chunks_.push_back(make_scoped_ptr(mc));
+ chunks_.push_back(base::WrapUnique(mc));
void* mem = mc->Alloc(size);
DCHECK(mem);
*shm_id = mc->shm_id();
diff --git a/gpu/command_buffer/client/mapped_memory.h b/gpu/command_buffer/client/mapped_memory.h
index 70831599..0af38b5 100644
--- a/gpu/command_buffer/client/mapped_memory.h
+++ b/gpu/command_buffer/client/mapped_memory.h
@@ -8,9 +8,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/trace_event/memory_dump_provider.h"
#include "gpu/command_buffer/client/fenced_allocator.h"
#include "gpu/command_buffer/common/buffer.h"
@@ -201,7 +202,7 @@
}
private:
- typedef std::vector<scoped_ptr<MemoryChunk>> MemoryChunkVector;
+ typedef std::vector<std::unique_ptr<MemoryChunk>> MemoryChunkVector;
// size a chunk is rounded up to.
unsigned int chunk_size_multiple_;
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc
index 9846a84d..8db9914 100644
--- a/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -8,8 +8,9 @@
#include <stdint.h>
#include <list>
+#include <memory>
+
#include "base/bind.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
@@ -68,11 +69,11 @@
int32_t GetToken() { return command_buffer_->GetLastState().token; }
- scoped_ptr<AsyncAPIMock> api_mock_;
+ std::unique_ptr<AsyncAPIMock> api_mock_;
scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<CommandBufferService> command_buffer_;
- scoped_ptr<CommandExecutor> executor_;
- scoped_ptr<CommandBufferHelper> helper_;
+ std::unique_ptr<CommandBufferService> command_buffer_;
+ std::unique_ptr<CommandExecutor> executor_;
+ std::unique_ptr<CommandBufferHelper> helper_;
base::MessageLoop message_loop_;
};
@@ -89,7 +90,7 @@
static const int32_t kShmId = 123;
void SetUp() override {
MappedMemoryTestBase::SetUp();
- scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kBufferSize);
buffer_ = MakeBufferFromSharedMemory(std::move(shared_memory), kBufferSize);
chunk_.reset(new MemoryChunk(kShmId, buffer_, helper_.get()));
@@ -104,7 +105,7 @@
uint8_t* buffer_memory() { return static_cast<uint8_t*>(buffer_->memory()); }
- scoped_ptr<MemoryChunk> chunk_;
+ std::unique_ptr<MemoryChunk> chunk_;
scoped_refptr<gpu::Buffer> buffer_;
};
@@ -162,7 +163,7 @@
MappedMemoryTestBase::TearDown();
}
- scoped_ptr<MappedMemoryManager> manager_;
+ std::unique_ptr<MappedMemoryManager> manager_;
};
TEST_F(MappedMemoryManagerTest, Basic) {
diff --git a/gpu/command_buffer/client/program_info_manager_unittest.cc b/gpu/command_buffer/client/program_info_manager_unittest.cc
index 64d896c..19aa12e 100644
--- a/gpu/command_buffer/client/program_info_manager_unittest.cc
+++ b/gpu/command_buffer/client/program_info_manager_unittest.cc
@@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/client/program_info_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -165,7 +167,7 @@
memcpy(data->name1, kName[1], arraysize(data->name1));
}
- scoped_ptr<ProgramInfoManager> program_info_manager_;
+ std::unique_ptr<ProgramInfoManager> program_info_manager_;
Program* program_;
};
diff --git a/gpu/command_buffer/client/query_tracker_unittest.cc b/gpu/command_buffer/client/query_tracker_unittest.cc
index a110087..78ab936d1 100644
--- a/gpu/command_buffer/client/query_tracker_unittest.cc
+++ b/gpu/command_buffer/client/query_tracker_unittest.cc
@@ -10,9 +10,9 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <vector>
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/mapped_memory.h"
@@ -45,10 +45,10 @@
command_buffer_.reset();
}
- scoped_ptr<CommandBuffer> command_buffer_;
- scoped_ptr<GLES2CmdHelper> helper_;
- scoped_ptr<MappedMemoryManager> mapped_memory_;
- scoped_ptr<QuerySyncManager> sync_manager_;
+ std::unique_ptr<CommandBuffer> command_buffer_;
+ std::unique_ptr<GLES2CmdHelper> helper_;
+ std::unique_ptr<MappedMemoryManager> mapped_memory_;
+ std::unique_ptr<QuerySyncManager> sync_manager_;
};
TEST_F(QuerySyncManagerTest, Basic) {
@@ -113,10 +113,10 @@
uint32_t GetFlushGeneration() { return helper_->flush_generation(); }
- scoped_ptr<CommandBuffer> command_buffer_;
- scoped_ptr<GLES2CmdHelper> helper_;
- scoped_ptr<MappedMemoryManager> mapped_memory_;
- scoped_ptr<QueryTracker> query_tracker_;
+ std::unique_ptr<CommandBuffer> command_buffer_;
+ std::unique_ptr<GLES2CmdHelper> helper_;
+ std::unique_ptr<MappedMemoryManager> mapped_memory_;
+ std::unique_ptr<QueryTracker> query_tracker_;
};
TEST_F(QueryTrackerTest, Basic) {
diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc
index cf3418f..3e1b2667 100644
--- a/gpu/command_buffer/client/ring_buffer_test.cc
+++ b/gpu/command_buffer/client/ring_buffer_test.cc
@@ -8,6 +8,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
@@ -91,15 +93,15 @@
int32_t GetToken() { return command_buffer_->GetLastState().token; }
- scoped_ptr<AsyncAPIMock> api_mock_;
+ std::unique_ptr<AsyncAPIMock> api_mock_;
scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<CommandBufferService> command_buffer_;
- scoped_ptr<CommandExecutor> executor_;
- scoped_ptr<CommandBufferHelper> helper_;
+ std::unique_ptr<CommandBufferService> command_buffer_;
+ std::unique_ptr<CommandExecutor> executor_;
+ std::unique_ptr<CommandBufferHelper> helper_;
std::vector<const void*> set_token_arguments_;
bool delay_set_token_;
- scoped_ptr<int8_t[]> buffer_;
+ std::unique_ptr<int8_t[]> buffer_;
int8_t* buffer_start_;
base::MessageLoop message_loop_;
};
@@ -131,7 +133,7 @@
BaseRingBufferTest::TearDown();
}
- scoped_ptr<RingBuffer> allocator_;
+ std::unique_ptr<RingBuffer> allocator_;
};
// Checks basic alloc and free.
diff --git a/gpu/command_buffer/client/share_group.h b/gpu/command_buffer/client/share_group.h
index 25427e3..066c6e6 100644
--- a/gpu/command_buffer/client/share_group.h
+++ b/gpu/command_buffer/client/share_group.h
@@ -7,8 +7,10 @@
#include <GLES2/gl2.h>
#include <stdint.h>
+
+#include <memory>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gles2_impl_export.h"
#include "gpu/command_buffer/client/ref_counted.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -152,10 +154,11 @@
// Install a new program info manager. Used for testing only;
void set_program_info_manager(ProgramInfoManager* manager);
- scoped_ptr<IdHandlerInterface> id_handlers_[id_namespaces::kNumIdNamespaces];
- scoped_ptr<RangeIdHandlerInterface>
+ std::unique_ptr<IdHandlerInterface>
+ id_handlers_[id_namespaces::kNumIdNamespaces];
+ std::unique_ptr<RangeIdHandlerInterface>
range_id_handlers_[id_namespaces::kNumRangeIdNamespaces];
- scoped_ptr<ProgramInfoManager> program_info_manager_;
+ std::unique_ptr<ProgramInfoManager> program_info_manager_;
bool bind_generates_resource_;
uint64_t tracing_guid_;
diff --git a/gpu/command_buffer/client/transfer_buffer.h b/gpu/command_buffer/client/transfer_buffer.h
index 43fea94..5f6623e 100644
--- a/gpu/command_buffer/client/transfer_buffer.h
+++ b/gpu/command_buffer/client/transfer_buffer.h
@@ -8,9 +8,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/ring_buffer.h"
#include "gpu/command_buffer/common/buffer.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -97,7 +98,7 @@
void AllocateRingBuffer(unsigned int size);
CommandBufferHelper* helper_;
- scoped_ptr<RingBuffer> ring_buffer_;
+ std::unique_ptr<RingBuffer> ring_buffer_;
// size reserved for results
unsigned int result_size_;
diff --git a/gpu/command_buffer/client/transfer_buffer_unittest.cc b/gpu/command_buffer/client/transfer_buffer_unittest.cc
index 7a98b804..336b992 100644
--- a/gpu/command_buffer/client/transfer_buffer_unittest.cc
+++ b/gpu/command_buffer/client/transfer_buffer_unittest.cc
@@ -9,6 +9,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "gpu/command_buffer/client/client_test_helper.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
@@ -56,9 +58,9 @@
return command_buffer_.get();
}
- scoped_ptr<MockClientCommandBufferMockFlush> command_buffer_;
- scoped_ptr<CommandBufferHelper> helper_;
- scoped_ptr<TransferBuffer> transfer_buffer_;
+ std::unique_ptr<MockClientCommandBufferMockFlush> command_buffer_;
+ std::unique_ptr<CommandBufferHelper> helper_;
+ std::unique_ptr<TransferBuffer> transfer_buffer_;
int32_t transfer_buffer_id_;
};
@@ -260,9 +262,9 @@
return command_buffer_.get();
}
- scoped_ptr<MockClientCommandBufferCanFail> command_buffer_;
- scoped_ptr<CommandBufferHelper> helper_;
- scoped_ptr<TransferBuffer> transfer_buffer_;
+ std::unique_ptr<MockClientCommandBufferCanFail> command_buffer_;
+ std::unique_ptr<CommandBufferHelper> helper_;
+ std::unique_ptr<TransferBuffer> transfer_buffer_;
int32_t transfer_buffer_id_;
};
diff --git a/gpu/command_buffer/client/vertex_array_object_manager.h b/gpu/command_buffer/client/vertex_array_object_manager.h
index 6897c929..42ec269 100644
--- a/gpu/command_buffer/client/vertex_array_object_manager.h
+++ b/gpu/command_buffer/client/vertex_array_object_manager.h
@@ -8,9 +8,10 @@
#include <GLES2/gl2.h>
#include <stdint.h>
+#include <memory>
+
#include "base/containers/hash_tables.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gles2_impl_export.h"
namespace gpu {
@@ -113,7 +114,7 @@
GLuint element_array_buffer_id_;
GLsizei element_array_buffer_size_;
GLsizei collection_buffer_size_;
- scoped_ptr<int8_t[]> collection_buffer_;
+ std::unique_ptr<int8_t[]> collection_buffer_;
VertexArrayObject* default_vertex_array_object_;
VertexArrayObject* bound_vertex_array_object_;
diff --git a/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc b/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
index b39aab8..77b6b4c 100644
--- a/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
+++ b/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
@@ -6,8 +6,12 @@
#include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
+
#include <stddef.h>
#include <stdint.h>
+
+#include <memory>
+
#include "testing/gtest/include/gtest/gtest.h"
namespace gpu {
@@ -29,7 +33,7 @@
}
void TearDown() override {}
- scoped_ptr<VertexArrayObjectManager> manager_;
+ std::unique_ptr<VertexArrayObjectManager> manager_;
};
// GCC requires these declarations, but MSVC requires they not be present
diff --git a/gpu/command_buffer/common/buffer.cc b/gpu/command_buffer/common/buffer.cc
index 02c77778..1bb9523 100644
--- a/gpu/command_buffer/common/buffer.cc
+++ b/gpu/command_buffer/common/buffer.cc
@@ -14,7 +14,7 @@
namespace gpu {
SharedMemoryBufferBacking::SharedMemoryBufferBacking(
- scoped_ptr<base::SharedMemory> shared_memory,
+ std::unique_ptr<base::SharedMemory> shared_memory,
size_t size)
: shared_memory_(std::move(shared_memory)), size_(size) {}
@@ -26,7 +26,7 @@
size_t SharedMemoryBufferBacking::GetSize() const { return size_; }
-Buffer::Buffer(scoped_ptr<BufferBacking> backing)
+Buffer::Buffer(std::unique_ptr<BufferBacking> backing)
: backing_(std::move(backing)),
memory_(backing_->GetMemory()),
size_(backing_->GetSize()) {
diff --git a/gpu/command_buffer/common/buffer.h b/gpu/command_buffer/common/buffer.h
index 1e427f2..0aea591 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 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 @@
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 @@
// 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 @@
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));
diff --git a/gpu/command_buffer/common/command_buffer_shared_test.cc b/gpu/command_buffer/common/command_buffer_shared_test.cc
index dc4bbed..4ae6040 100644
--- a/gpu/command_buffer/common/command_buffer_shared_test.cc
+++ b/gpu/command_buffer/common/command_buffer_shared_test.cc
@@ -8,9 +8,10 @@
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/location.h"
-#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -24,7 +25,7 @@
shared_state_->Initialize();
}
- scoped_ptr<CommandBufferSharedState> shared_state_;
+ std::unique_ptr<CommandBufferSharedState> shared_state_;
};
TEST_F(CommandBufferSharedTest, TestBasic) {
@@ -57,7 +58,7 @@
}
TEST_F(CommandBufferSharedTest, TestConsistency) {
- scoped_ptr<int32_t[]> buffer;
+ std::unique_ptr<int32_t[]> buffer;
buffer.reset(new int32_t[kSize]);
base::Thread consumer("Reader Thread");
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h
index 8ababfa..59547229 100644
--- a/gpu/command_buffer/service/buffer_manager.h
+++ b/gpu/command_buffer/service/buffer_manager.h
@@ -9,13 +9,13 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/common/buffer.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/memory_tracking.h"
@@ -205,7 +205,7 @@
GLenum usage_;
// Data cached from last glMapBufferRange call.
- scoped_ptr<MappedRange> mapped_range_;
+ std::unique_ptr<MappedRange> mapped_range_;
// A map of ranges to the highest value in that range of a certain type.
typedef std::map<Range, GLuint, Range::Less> RangeToMaxValueMap;
@@ -328,7 +328,7 @@
GLenum usage,
bool use_shadow);
- scoped_ptr<MemoryTypeTracker> memory_type_tracker_;
+ std::unique_ptr<MemoryTypeTracker> memory_type_tracker_;
MemoryTracker* memory_tracker_;
scoped_refptr<FeatureInfo> feature_info_;
diff --git a/gpu/command_buffer/service/buffer_manager_unittest.cc b/gpu/command_buffer/service/buffer_manager_unittest.cc
index 30027592..c838a12 100644
--- a/gpu/command_buffer/service/buffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/buffer_manager_unittest.cc
@@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/error_state_mock.h"
#include "gpu/command_buffer/service/feature_info.h"
@@ -226,8 +228,8 @@
40, 1, GL_UNSIGNED_INT, enable_primitive_restart, &max_value));
}
- scoped_ptr<BufferManager> manager_;
- scoped_ptr<MockErrorState> error_state_;
+ std::unique_ptr<BufferManager> manager_;
+ std::unique_ptr<MockErrorState> error_state_;
};
class BufferManagerTest : public BufferManagerTestBase {
@@ -363,7 +365,7 @@
EXPECT_FALSE(DoBufferSubData(buffer, kTarget, 0, -1, data));
DoBufferData(buffer, kTarget, 1, GL_STATIC_DRAW, NULL, GL_NO_ERROR);
const int size = 0x20000;
- scoped_ptr<uint8_t[]> temp(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> temp(new uint8_t[size]);
EXPECT_FALSE(DoBufferSubData(buffer, kTarget, 0 - size, size, temp.get()));
EXPECT_FALSE(DoBufferSubData(buffer, kTarget, 1, size / 2, temp.get()));
}
diff --git a/gpu/command_buffer/service/cmd_parser_test.cc b/gpu/command_buffer/service/cmd_parser_test.cc
index 7df519d7..b1ed3a27 100644
--- a/gpu/command_buffer/service/cmd_parser_test.cc
+++ b/gpu/command_buffer/service/cmd_parser_test.cc
@@ -6,8 +6,9 @@
#include <stddef.h>
+#include <memory>
+
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/cmd_parser.h"
#include "gpu/command_buffer/service/mocks.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -61,14 +62,14 @@
CommandBufferEntry *buffer() { return buffer_.get(); }
private:
unsigned int buffer_entry_count_;
- scoped_ptr<AsyncAPIMock> api_mock_;
- scoped_ptr<CommandBufferEntry[]> buffer_;
+ std::unique_ptr<AsyncAPIMock> api_mock_;
+ std::unique_ptr<CommandBufferEntry[]> buffer_;
Sequence sequence_;
};
// Tests initialization conditions.
TEST_F(CommandParserTest, TestInit) {
- scoped_ptr<CommandParser> parser(MakeParser(10));
+ std::unique_ptr<CommandParser> parser(MakeParser(10));
EXPECT_EQ(0, parser->get());
EXPECT_EQ(0, parser->put());
EXPECT_TRUE(parser->IsEmpty());
@@ -76,7 +77,7 @@
// Tests simple commands.
TEST_F(CommandParserTest, TestSimple) {
- scoped_ptr<CommandParser> parser(MakeParser(10));
+ std::unique_ptr<CommandParser> parser(MakeParser(10));
CommandBufferOffset put = parser->put();
CommandHeader header;
@@ -109,7 +110,7 @@
// Tests having multiple commands in the buffer.
TEST_F(CommandParserTest, TestMultipleCommands) {
- scoped_ptr<CommandParser> parser(MakeParser(10));
+ std::unique_ptr<CommandParser> parser(MakeParser(10));
CommandBufferOffset put = parser->put();
CommandHeader header;
@@ -161,7 +162,7 @@
// Tests that the parser will wrap correctly at the end of the buffer.
TEST_F(CommandParserTest, TestWrap) {
- scoped_ptr<CommandParser> parser(MakeParser(5));
+ std::unique_ptr<CommandParser> parser(MakeParser(5));
CommandBufferOffset put = parser->put();
CommandHeader header;
@@ -213,7 +214,7 @@
// Tests error conditions.
TEST_F(CommandParserTest, TestError) {
const unsigned int kNumEntries = 5;
- scoped_ptr<CommandParser> parser(MakeParser(kNumEntries));
+ std::unique_ptr<CommandParser> parser(MakeParser(kNumEntries));
CommandBufferOffset put = parser->put();
CommandHeader header;
@@ -285,7 +286,7 @@
}
TEST_F(CommandParserTest, SetBuffer) {
- scoped_ptr<CommandParser> parser(MakeParser(3));
+ std::unique_ptr<CommandParser> parser(MakeParser(3));
CommandBufferOffset put = parser->put();
CommandHeader header;
@@ -303,7 +304,7 @@
EXPECT_EQ(2, parser->get());
Mock::VerifyAndClearExpectations(api_mock());
- scoped_ptr<CommandBufferEntry[]> buffer2(new CommandBufferEntry[2]);
+ std::unique_ptr<CommandBufferEntry[]> buffer2(new CommandBufferEntry[2]);
parser->SetBuffer(
buffer2.get(), sizeof(CommandBufferEntry) * 2, 0,
sizeof(CommandBufferEntry) * 2);
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 368bc1c..9c3d9b0 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <limits>
+#include <memory>
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
@@ -105,7 +106,7 @@
}
void CommandBufferService::SetSharedStateBuffer(
- scoped_ptr<BufferBacking> shared_state_buffer) {
+ std::unique_ptr<BufferBacking> shared_state_buffer) {
shared_state_buffer_ = std::move(shared_state_buffer);
DCHECK(shared_state_buffer_->GetSize() >= sizeof(*shared_state_));
@@ -124,7 +125,7 @@
int32_t* id) {
*id = -1;
- scoped_ptr<SharedMemory> shared_memory(new SharedMemory());
+ std::unique_ptr<SharedMemory> shared_memory(new SharedMemory());
if (!shared_memory->CreateAndMapAnonymous(size)) {
if (error_ == error::kNoError)
error_ = gpu::error::kOutOfBounds;
@@ -162,7 +163,7 @@
bool CommandBufferService::RegisterTransferBuffer(
int32_t id,
- scoped_ptr<BufferBacking> buffer) {
+ std::unique_ptr<BufferBacking> buffer) {
return transfer_buffer_manager_->RegisterTransferBuffer(id,
std::move(buffer));
}
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index 560bf163..df058767 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -8,6 +8,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/callback.h"
#include "base/macros.h"
#include "gpu/command_buffer/common/command_buffer.h"
@@ -85,19 +87,20 @@
virtual void SetParseErrorCallback(const base::Closure& callback);
// Setup the shared memory that shared state should be copied into.
- void SetSharedStateBuffer(scoped_ptr<BufferBacking> shared_state_buffer);
+ void SetSharedStateBuffer(std::unique_ptr<BufferBacking> shared_state_buffer);
// Copy the current state into the shared state transfer buffer.
void UpdateState();
// Registers an existing shared memory object and get an ID that can be used
// to identify it in the command buffer.
- bool RegisterTransferBuffer(int32_t id, scoped_ptr<BufferBacking> buffer);
+ bool RegisterTransferBuffer(int32_t id,
+ std::unique_ptr<BufferBacking> buffer);
private:
int32_t ring_buffer_id_;
scoped_refptr<Buffer> ring_buffer_;
- scoped_ptr<BufferBacking> shared_state_buffer_;
+ std::unique_ptr<BufferBacking> shared_state_buffer_;
CommandBufferSharedState* shared_state_;
int32_t num_entries_;
int32_t get_offset_;
diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc
index 5b39a96..2ee87b8 100644
--- a/gpu/command_buffer/service/command_buffer_service_unittest.cc
+++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc
@@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/threading/thread.h"
@@ -53,7 +55,7 @@
}
scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<CommandBufferService> command_buffer_;
+ std::unique_ptr<CommandBufferService> command_buffer_;
};
TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) {
@@ -84,7 +86,7 @@
TEST_F(CommandBufferServiceTest, CanSyncGetAndPutOffset) {
Initialize(1024);
- scoped_ptr<StrictMock<MockCallbackTest> > change_callback(
+ std::unique_ptr<StrictMock<MockCallbackTest>> change_callback(
new StrictMock<MockCallbackTest>);
command_buffer_->SetPutOffsetChangeCallback(
base::Bind(
@@ -117,7 +119,7 @@
command_buffer_->CreateTransferBuffer(1024, &ring_buffer_id);
EXPECT_GT(ring_buffer_id, 0);
- scoped_ptr<StrictMock<MockCallbackTest> > change_callback(
+ std::unique_ptr<StrictMock<MockCallbackTest>> change_callback(
new StrictMock<MockCallbackTest>);
command_buffer_->SetGetBufferChangeCallback(
base::Bind(
diff --git a/gpu/command_buffer/service/command_executor.h b/gpu/command_buffer/service/command_executor.h
index d437325..bd90d6f 100644
--- a/gpu/command_buffer/service/command_executor.h
+++ b/gpu/command_buffer/service/command_executor.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <memory>
#include <queue>
#include "base/atomic_ref_count.h"
@@ -15,7 +16,6 @@
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
#include "base/memory/weak_ptr.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
@@ -114,7 +114,7 @@
// TODO(apatrick): The CommandExecutor currently creates and owns the parser.
// This should be an argument to the constructor.
- scoped_ptr<CommandParser> parser_;
+ std::unique_ptr<CommandParser> parser_;
// Whether the scheduler is currently able to process more commands.
bool scheduled_;
diff --git a/gpu/command_buffer/service/command_executor_unittest.cc b/gpu/command_buffer/service/command_executor_unittest.cc
index 0002fd9..bcee267 100644
--- a/gpu/command_buffer/service/command_executor_unittest.cc
+++ b/gpu/command_buffer/service/command_executor_unittest.cc
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/common/command_buffer_mock.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
@@ -31,7 +33,7 @@
static const int32_t kTransferBufferId = 123;
void SetUp() override {
- scoped_ptr<base::SharedMemory> shared_memory(new ::base::SharedMemory);
+ std::unique_ptr<base::SharedMemory> shared_memory(new ::base::SharedMemory);
shared_memory->CreateAndMapAnonymous(kRingBufferSize);
buffer_ = static_cast<int32_t*>(shared_memory->memory());
shared_memory_buffer_ =
@@ -68,11 +70,11 @@
error::Error GetError() { return command_buffer_->GetLastState().error; }
- scoped_ptr<MockCommandBuffer> command_buffer_;
+ std::unique_ptr<MockCommandBuffer> command_buffer_;
scoped_refptr<Buffer> shared_memory_buffer_;
int32_t* buffer_;
- scoped_ptr<gles2::MockGLES2Decoder> decoder_;
- scoped_ptr<CommandExecutor> executor_;
+ std::unique_ptr<gles2::MockGLES2Decoder> decoder_;
+ std::unique_ptr<CommandExecutor> executor_;
base::MessageLoop message_loop_;
};
diff --git a/gpu/command_buffer/service/common_decoder.h b/gpu/command_buffer/service/common_decoder.h
index 147b776..a8b5d75 100644
--- a/gpu/command_buffer/service/common_decoder.h
+++ b/gpu/command_buffer/service/common_decoder.h
@@ -9,11 +9,12 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <stack>
#include <string>
+
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/common/buffer.h"
#include "gpu/command_buffer/service/cmd_parser.h"
#include "gpu/gpu_export.h"
@@ -104,7 +105,7 @@
}
size_t size_;
- ::scoped_ptr<int8_t[]> data_;
+ ::std::unique_ptr<int8_t[]> data_;
DISALLOW_COPY_AND_ASSIGN(Bucket);
};
diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc
index ac4ba1c..c647e56 100644
--- a/gpu/command_buffer/service/common_decoder_unittest.cc
+++ b/gpu/command_buffer/service/common_decoder_unittest.cc
@@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/common_decoder.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -83,7 +85,7 @@
: CommandBufferEngine(),
token_(),
get_offset_(0) {
- scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kBufferSize);
buffer_ = MakeBufferFromSharedMemory(std::move(shared_memory), kBufferSize);
}
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h
index b4d861a..26f1e3a 100644
--- a/gpu/command_buffer/service/context_group.h
+++ b/gpu/command_buffer/service/context_group.h
@@ -7,11 +7,12 @@
#include <stdint.h>
+#include <memory>
#include <vector>
+
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -281,23 +282,23 @@
ProgramCache* program_cache_;
- scoped_ptr<BufferManager> buffer_manager_;
+ std::unique_ptr<BufferManager> buffer_manager_;
- scoped_ptr<FramebufferManager> framebuffer_manager_;
+ std::unique_ptr<FramebufferManager> framebuffer_manager_;
- scoped_ptr<RenderbufferManager> renderbuffer_manager_;
+ std::unique_ptr<RenderbufferManager> renderbuffer_manager_;
- scoped_ptr<TextureManager> texture_manager_;
+ std::unique_ptr<TextureManager> texture_manager_;
- scoped_ptr<PathManager> path_manager_;
+ std::unique_ptr<PathManager> path_manager_;
- scoped_ptr<ProgramManager> program_manager_;
+ std::unique_ptr<ProgramManager> program_manager_;
- scoped_ptr<ShaderManager> shader_manager_;
+ std::unique_ptr<ShaderManager> shader_manager_;
- scoped_ptr<SamplerManager> sampler_manager_;
+ std::unique_ptr<SamplerManager> sampler_manager_;
- scoped_ptr<ValuebufferManager> valuebuffer_manager_;
+ std::unique_ptr<ValuebufferManager> valuebuffer_manager_;
scoped_refptr<FeatureInfo> feature_info_;
diff --git a/gpu/command_buffer/service/context_group_unittest.cc b/gpu/command_buffer/service/context_group_unittest.cc
index bd0fbf9..4bfedc9 100644
--- a/gpu/command_buffer/service/context_group_unittest.cc
+++ b/gpu/command_buffer/service/context_group_unittest.cc
@@ -6,7 +6,8 @@
#include <stdint.h>
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/command_buffer/common/value_state.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
@@ -49,7 +50,7 @@
}
GpuPreferences gpu_preferences_;
- scoped_ptr<MockGLES2Decoder> decoder_;
+ std::unique_ptr<MockGLES2Decoder> decoder_;
scoped_refptr<ContextGroup> group_;
};
@@ -106,7 +107,7 @@
}
TEST_F(ContextGroupTest, MultipleContexts) {
- scoped_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder());
+ std::unique_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder());
TestHelper::SetupContextGroupInitExpectations(
gl_.get(), DisallowedFeatures(), "", "", kBindGeneratesResource);
EXPECT_TRUE(group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2,
diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h
index 7f3211c..b8b76036 100644
--- a/gpu/command_buffer/service/context_state.h
+++ b/gpu/command_buffer/service/context_state.h
@@ -7,15 +7,16 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_
#define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_
+#include <memory>
#include <vector>
+
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/sampler_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/command_buffer/service/valuebuffer_manager.h"
-#include "gpu/command_buffer/service/vertex_attrib_manager.h"
#include "gpu/command_buffer/service/vertex_array_manager.h"
+#include "gpu/command_buffer/service/vertex_attrib_manager.h"
#include "gpu/gpu_export.h"
namespace gpu {
@@ -308,7 +309,7 @@
void InitStateManual(const ContextState* prev_state) const;
FeatureInfo* feature_info_;
- scoped_ptr<ErrorState> error_state_;
+ std::unique_ptr<ErrorState> error_state_;
};
} // namespace gles2
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h
index e7b853b..99cd9e03 100644
--- a/gpu/command_buffer/service/feature_info.h
+++ b/gpu/command_buffer/service/feature_info.h
@@ -5,10 +5,11 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_
#define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_
+#include <memory>
#include <string>
+
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gles2_cmd_validation.h"
#include "gpu/config/gpu_driver_bug_workarounds.h"
@@ -188,7 +189,7 @@
bool oes_texture_half_float_linear_available_;
bool disable_shader_translator_;
- scoped_ptr<gfx::GLVersionInfo> gl_version_info_;
+ std::unique_ptr<gfx::GLVersionInfo> gl_version_info_;
DISALLOW_COPY_AND_ASSIGN(FeatureInfo);
};
diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc
index b1a90b4..fbcd9120 100644
--- a/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -6,8 +6,9 @@
#include <stddef.h>
+#include <memory>
+
#include "base/command_line.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/gpu_switches.h"
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index 3c4fad3..d649635 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -444,7 +444,7 @@
}
bool Framebuffer::PrepareDrawBuffersForClear() const {
- scoped_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]);
+ std::unique_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]);
for (uint32_t i = 0; i < manager_->max_draw_buffers_; ++i)
buffers[i] = GL_NONE;
for (AttachmentMap::const_iterator it = attachments_.begin();
diff --git a/gpu/command_buffer/service/framebuffer_manager.h b/gpu/command_buffer/service/framebuffer_manager.h
index b6a2af30..bb0de01 100644
--- a/gpu/command_buffer/service/framebuffer_manager.h
+++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -8,12 +8,12 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
@@ -225,7 +225,7 @@
typedef base::hash_map<GLenum, scoped_refptr<Attachment> > AttachmentMap;
AttachmentMap attachments_;
- scoped_ptr<GLenum[]> draw_buffers_;
+ std::unique_ptr<GLenum[]> draw_buffers_;
GLenum read_buffer_;
diff --git a/gpu/command_buffer/service/framebuffer_manager_unittest.cc b/gpu/command_buffer/service/framebuffer_manager_unittest.cc
index c3538c59..0d7f898e 100644
--- a/gpu/command_buffer/service/framebuffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/framebuffer_manager_unittest.cc
@@ -61,8 +61,8 @@
protected:
FramebufferManager manager_;
scoped_refptr<FeatureInfo> feature_info_;
- scoped_ptr<TextureManager> texture_manager_;
- scoped_ptr<RenderbufferManager> renderbuffer_manager_;
+ std::unique_ptr<TextureManager> texture_manager_;
+ std::unique_ptr<RenderbufferManager> renderbuffer_manager_;
};
TEST_F(FramebufferManagerTest, Basic) {
@@ -158,10 +158,10 @@
FramebufferManager manager_;
Framebuffer* framebuffer_;
scoped_refptr<FeatureInfo> feature_info_;
- scoped_ptr<TextureManager> texture_manager_;
- scoped_ptr<RenderbufferManager> renderbuffer_manager_;
- scoped_ptr<MockErrorState> error_state_;
- scoped_ptr<MockGLES2Decoder> decoder_;
+ std::unique_ptr<TextureManager> texture_manager_;
+ std::unique_ptr<RenderbufferManager> renderbuffer_manager_;
+ std::unique_ptr<MockErrorState> error_state_;
+ std::unique_ptr<MockGLES2Decoder> decoder_;
};
class FramebufferInfoTest : public FramebufferInfoTestBase {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index a3cef98..e80c41b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -13,13 +13,13 @@
#include <cmath>
#include <list>
#include <map>
+#include <memory>
#include <queue>
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/linked_ptr.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_number_conversions.h"
@@ -401,7 +401,7 @@
private:
GLuint temp_texture_id_ = 0;
GLuint temp_fbo_id_ = 0;
- scoped_ptr<ScopedFrameBufferBinder> fbo_binder_;
+ std::unique_ptr<ScopedFrameBufferBinder> fbo_binder_;
DISALLOW_COPY_AND_ASSIGN(ScopedFrameBufferReadPixelHelper);
};
@@ -527,7 +527,7 @@
DCHECK(fence);
}
std::vector<base::Closure> callbacks;
- scoped_ptr<gfx::GLFence> fence;
+ std::unique_ptr<gfx::GLFence> fence;
};
// } // anonymous namespace.
@@ -2016,11 +2016,11 @@
// depth and stencil buffers are separate. With regular GL there is a single
// packed depth stencil buffer in offscreen_target_depth_render_buffer_.
// offscreen_target_stencil_render_buffer_ is unused.
- scoped_ptr<BackFramebuffer> offscreen_target_frame_buffer_;
- scoped_ptr<BackTexture> offscreen_target_color_texture_;
- scoped_ptr<BackRenderbuffer> offscreen_target_color_render_buffer_;
- scoped_ptr<BackRenderbuffer> offscreen_target_depth_render_buffer_;
- scoped_ptr<BackRenderbuffer> offscreen_target_stencil_render_buffer_;
+ std::unique_ptr<BackFramebuffer> offscreen_target_frame_buffer_;
+ std::unique_ptr<BackTexture> offscreen_target_color_texture_;
+ std::unique_ptr<BackRenderbuffer> offscreen_target_color_render_buffer_;
+ std::unique_ptr<BackRenderbuffer> offscreen_target_depth_render_buffer_;
+ std::unique_ptr<BackRenderbuffer> offscreen_target_stencil_render_buffer_;
GLenum offscreen_target_color_format_;
GLenum offscreen_target_depth_format_;
GLenum offscreen_target_stencil_format_;
@@ -2028,21 +2028,21 @@
GLboolean offscreen_target_buffer_preserved_;
// The copy that is saved when SwapBuffers is called.
- scoped_ptr<BackFramebuffer> offscreen_saved_frame_buffer_;
- scoped_ptr<BackTexture> offscreen_saved_color_texture_;
+ std::unique_ptr<BackFramebuffer> offscreen_saved_frame_buffer_;
+ std::unique_ptr<BackTexture> offscreen_saved_color_texture_;
scoped_refptr<TextureRef>
offscreen_saved_color_texture_info_;
// The copy that is used as the destination for multi-sample resolves.
- scoped_ptr<BackFramebuffer> offscreen_resolved_frame_buffer_;
- scoped_ptr<BackTexture> offscreen_resolved_color_texture_;
+ std::unique_ptr<BackFramebuffer> offscreen_resolved_frame_buffer_;
+ std::unique_ptr<BackTexture> offscreen_resolved_color_texture_;
GLenum offscreen_saved_color_format_;
- scoped_ptr<QueryManager> query_manager_;
+ std::unique_ptr<QueryManager> query_manager_;
- scoped_ptr<VertexArrayManager> vertex_array_manager_;
+ std::unique_ptr<VertexArrayManager> vertex_array_manager_;
- scoped_ptr<ImageManager> image_manager_;
+ std::unique_ptr<ImageManager> image_manager_;
FenceSyncReleaseCallback fence_sync_release_callback_;
WaitFenceSyncCallback wait_fence_sync_callback_;
@@ -2118,8 +2118,8 @@
TextureToIOSurfaceMap texture_to_io_surface_map_;
#endif
- scoped_ptr<CopyTextureCHROMIUMResourceManager> copy_texture_CHROMIUM_;
- scoped_ptr<ClearFramebufferResourceManager> clear_framebuffer_blit_;
+ std::unique_ptr<CopyTextureCHROMIUMResourceManager> copy_texture_CHROMIUM_;
+ std::unique_ptr<ClearFramebufferResourceManager> clear_framebuffer_blit_;
// Cached values of the currently assigned viewport dimensions.
GLsizei viewport_max_width_;
@@ -2132,8 +2132,8 @@
DecoderTextureState texture_state_;
DecoderFramebufferState framebuffer_state_;
- scoped_ptr<GPUTracer> gpu_tracer_;
- scoped_ptr<GPUStateTracer> gpu_state_tracer_;
+ std::unique_ptr<GPUTracer> gpu_tracer_;
+ std::unique_ptr<GPUStateTracer> gpu_state_tracer_;
const unsigned char* gpu_decoder_category_;
int gpu_trace_level_;
bool gpu_trace_commands_;
@@ -2422,7 +2422,7 @@
return false;
}
- scoped_ptr<char[]> zero_data;
+ std::unique_ptr<char[]> zero_data;
if (zero) {
zero_data.reset(new char[image_size]);
memset(zero_data.get(), 0, image_size);
@@ -3447,7 +3447,7 @@
return false;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenBuffersARB(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
CreateBuffer(client_ids[ii], service_ids[ii]);
@@ -3462,7 +3462,7 @@
return false;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenFramebuffersEXT(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
CreateFramebuffer(client_ids[ii], service_ids[ii]);
@@ -3477,7 +3477,7 @@
return false;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenRenderbuffersEXT(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
CreateRenderbuffer(client_ids[ii], service_ids[ii]);
@@ -3504,7 +3504,7 @@
return false;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenTextures(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
CreateTexture(client_ids[ii], service_ids[ii]);
@@ -3518,7 +3518,7 @@
return false;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenSamplers(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
CreateSampler(client_ids[ii], service_ids[ii]);
@@ -5111,7 +5111,7 @@
// If the default framebuffer is bound but we are still rendering to an
// FBO, translate attachment names that refer to default framebuffer
// channels to corresponding framebuffer attachments.
- scoped_ptr<GLenum[]> translated_attachments(new GLenum[count]);
+ std::unique_ptr<GLenum[]> translated_attachments(new GLenum[count]);
for (GLsizei i = 0; i < count; ++i) {
GLenum attachment = attachments[i];
if (!framebuffer && GetBackbufferServiceId()) {
@@ -5795,7 +5795,7 @@
DCHECK(params);
GLsizei num_written = 0;
if (GetNumValuesReturnedForGLGet(pname, &num_written)) {
- scoped_ptr<GLint[]> values(new GLint[num_written]);
+ std::unique_ptr<GLint[]> values(new GLint[num_written]);
if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) {
GetHelper(pname, values.get(), &num_written);
}
@@ -5813,7 +5813,7 @@
GLsizei num_written = 0;
if (!state_.GetStateAsGLfloat(pname, params, &num_written)) {
if (GetHelper(pname, NULL, &num_written)) {
- scoped_ptr<GLint[]> values(new GLint[num_written]);
+ std::unique_ptr<GLint[]> values(new GLint[num_written]);
GetHelper(pname, values.get(), &num_written);
for (GLsizei ii = 0; ii < num_written; ++ii) {
params[ii] = static_cast<GLfloat>(values[ii]);
@@ -7477,7 +7477,7 @@
return;
}
if (type == GL_BOOL) {
- scoped_ptr<GLint[]> temp(new GLint[count]);
+ std::unique_ptr<GLint[]> temp(new GLint[count]);
for (GLsizei ii = 0; ii < count; ++ii) {
temp[ii] = static_cast<GLint>(value[ii] != 0.0f);
}
@@ -7501,7 +7501,7 @@
}
if (type == GL_BOOL_VEC2) {
GLsizei num_values = count * 2;
- scoped_ptr<GLint[]> temp(new GLint[num_values]);
+ std::unique_ptr<GLint[]> temp(new GLint[num_values]);
for (GLsizei ii = 0; ii < num_values; ++ii) {
temp[ii] = static_cast<GLint>(value[ii] != 0.0f);
}
@@ -7525,7 +7525,7 @@
}
if (type == GL_BOOL_VEC3) {
GLsizei num_values = count * 3;
- scoped_ptr<GLint[]> temp(new GLint[num_values]);
+ std::unique_ptr<GLint[]> temp(new GLint[num_values]);
for (GLsizei ii = 0; ii < num_values; ++ii) {
temp[ii] = static_cast<GLint>(value[ii] != 0.0f);
}
@@ -7549,7 +7549,7 @@
}
if (type == GL_BOOL_VEC4) {
GLsizei num_values = count * 4;
- scoped_ptr<GLint[]> temp(new GLint[num_values]);
+ std::unique_ptr<GLint[]> temp(new GLint[num_values]);
for (GLsizei ii = 0; ii < num_values; ++ii) {
temp[ii] = static_cast<GLint>(value[ii] != 0.0f);
}
@@ -8278,7 +8278,7 @@
int num_elements = attrib->size() * num_vertices;
const int src_size = num_elements * sizeof(int32_t);
const int dst_size = num_elements * sizeof(float);
- scoped_ptr<float[]> data(new float[num_elements]);
+ std::unique_ptr<float[]> data(new float[num_elements]);
const int32_t* src = reinterpret_cast<const int32_t*>(
attrib->buffer()->GetRange(attrib->offset(), src_size));
const int32_t* end = src + num_elements;
@@ -9681,7 +9681,7 @@
LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glReadPixels");
ScopedResolvedFrameBufferBinder binder(this, false, true);
- scoped_ptr<ScopedFrameBufferReadPixelHelper> helper;
+ std::unique_ptr<ScopedFrameBufferReadPixelHelper> helper;
if (NeedsIOSurfaceReadbackWorkaround())
helper.reset(new ScopedFrameBufferReadPixelHelper(&state_, this));
@@ -10480,7 +10480,7 @@
}
// Assumes the size has already been checked.
- scoped_ptr<char[]> zero(new char[size]);
+ std::unique_ptr<char[]> zero(new char[size]);
memset(zero.get(), 0, size);
glBindTexture(texture->target(), texture->service_id());
@@ -10592,7 +10592,7 @@
// Include padding as some drivers incorrectly requires padding for the
// last row.
buffer_size += padding;
- scoped_ptr<char[]> zero(new char[buffer_size]);
+ std::unique_ptr<char[]> zero(new char[buffer_size]);
memset(zero.get(), 0, buffer_size);
// TODO(zmo): Consider glMapBufferRange instead.
glBufferData(
@@ -11102,7 +11102,7 @@
framebuffer_state_.clear_state_dirty = true;
}
- scoped_ptr<int8_t[]> zero;
+ std::unique_ptr<int8_t[]> zero;
if (!data) {
zero.reset(new int8_t[image_size]);
memset(zero.get(), 0, image_size);
@@ -11297,7 +11297,7 @@
framebuffer_state_.clear_state_dirty = true;
}
- scoped_ptr<int8_t[]> zero;
+ std::unique_ptr<int8_t[]> zero;
if (!data) {
zero.reset(new int8_t[image_size]);
memset(zero.get(), 0, image_size);
@@ -11863,7 +11863,7 @@
copyWidth != width ||
copyHeight != height) {
// some part was clipped so clear the rect.
- scoped_ptr<char[]> zero(new char[pixels_size]);
+ std::unique_ptr<char[]> zero(new char[pixels_size]);
memset(zero.get(), 0, pixels_size);
glTexImage2D(target, level,
texture_manager()->AdjustTexInternalFormat(internal_format),
@@ -12385,7 +12385,7 @@
if (result_type == GL_BOOL || result_type == GL_BOOL_VEC2 ||
result_type == GL_BOOL_VEC3 || result_type == GL_BOOL_VEC4) {
GLsizei num_values = result_size / sizeof(GLfloat);
- scoped_ptr<GLint[]> temp(new GLint[num_values]);
+ std::unique_ptr<GLint[]> temp(new GLint[num_values]);
glGetUniformiv(service_id, real_location, temp.get());
GLfloat* dst = result->GetData();
for (GLsizei ii = 0; ii < num_values; ++ii) {
@@ -12746,7 +12746,7 @@
if (shaders == NULL || binary == NULL) {
return error::kOutOfBounds;
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
for (GLsizei ii = 0; ii < n; ++ii) {
Shader* shader = GetShader(shaders[ii]);
if (!shader) {
@@ -13585,7 +13585,7 @@
CreateVertexAttribManager(client_ids[ii], 0, true);
}
} else {
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenVertexArraysOES(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
@@ -15489,7 +15489,7 @@
bool GetPathNameData(const Cmd& cmd,
GLuint num_paths,
GLenum path_name_type,
- scoped_ptr<GLuint[]>* out_buffer) {
+ std::unique_ptr<GLuint[]>* out_buffer) {
DCHECK(validators_->path_name_type.IsValid(path_name_type));
GLuint path_base = static_cast<GLuint>(cmd.pathBase);
uint32_t shm_id = static_cast<uint32_t>(cmd.paths_shm_id);
@@ -15576,7 +15576,7 @@
GLuint path_base,
uint32_t shm_id,
uint32_t shm_offset,
- scoped_ptr<GLuint[]>* out_buffer) {
+ std::unique_ptr<GLuint[]>* out_buffer) {
uint32_t paths_size = 0;
if (!SafeMultiplyUint32(num_paths, sizeof(T), &paths_size)) {
error_ = error::kOutOfBounds;
@@ -15587,7 +15587,7 @@
error_ = error::kOutOfBounds;
return false;
}
- scoped_ptr<GLuint[]> result_paths(new GLuint[num_paths]);
+ std::unique_ptr<GLuint[]> result_paths(new GLuint[num_paths]);
bool has_paths = false;
for (GLuint i = 0; i < num_paths; ++i) {
GLuint service_id = 0;
@@ -15702,7 +15702,7 @@
return error::kNoError;
}
- scoped_ptr<GLubyte[]> commands;
+ std::unique_ptr<GLubyte[]> commands;
base::CheckedNumeric<GLsizei> num_coords_expected = 0;
if (num_commands > 0) {
@@ -16040,7 +16040,7 @@
if (num_paths == 0)
return error::kNoError;
- scoped_ptr<GLuint[]> paths;
+ std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
@@ -16074,7 +16074,7 @@
if (num_paths == 0)
return error::kNoError;
- scoped_ptr<GLuint[]> paths;
+ std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
@@ -16112,7 +16112,7 @@
if (num_paths == 0)
return error::kNoError;
- scoped_ptr<GLuint[]> paths;
+ std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
@@ -16148,7 +16148,7 @@
if (num_paths == 0)
return error::kNoError;
- scoped_ptr<GLuint[]> paths;
+ std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
@@ -16188,7 +16188,7 @@
if (num_paths == 0)
return error::kNoError;
- scoped_ptr<GLuint[]> paths;
+ std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
@@ -16227,7 +16227,7 @@
if (num_paths == 0)
return error::kNoError;
- scoped_ptr<GLuint[]> paths;
+ std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
index 54b8dcf..601f5d8 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -1310,7 +1310,7 @@
return error::kInvalidArguments;
}
}
- scoped_ptr<GLuint[]> service_ids(new GLuint[n]);
+ std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
glGenTransformFeedbacks(n, service_ids.get());
for (GLsizei ii = 0; ii < n; ++ii) {
group_->AddTransformFeedbackId(ids[ii], service_ids[ii]);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 51af934e..12010b1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include <string>
#include <vector>
@@ -647,7 +648,7 @@
char str_end) {
uint32_t header_size = sizeof(GLint) * (count + 1);
uint32_t total_size = header_size;
- scoped_ptr<GLint[]> header(new GLint[count + 1]);
+ std::unique_ptr<GLint[]> header(new GLint[count + 1]);
header[0] = static_cast<GLint>(count_in_header);
for (GLsizei ii = 0; ii < count; ++ii) {
header[ii + 1] = str && str[ii] ? strlen(str[ii]) : 0;
@@ -1989,8 +1990,7 @@
GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::
MockCommandBufferEngine() {
-
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory());
shm->CreateAndMapAnonymous(kSharedBufferSize);
valid_buffer_ = MakeBufferFromSharedMemory(std::move(shm), kSharedBufferSize);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 3756eac..a80e70d5 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -8,6 +8,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/message_loop/message_loop.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -631,11 +633,11 @@
static const char* kOutputVariable1NameESSL3;
// Use StrictMock to make 100% sure we know how GL will be called.
- scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
+ std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_;
scoped_refptr<gfx::GLSurfaceStub> surface_;
scoped_refptr<GLContextMock> context_;
- scoped_ptr<MockGLES2Decoder> mock_decoder_;
- scoped_ptr<GLES2Decoder> decoder_;
+ std::unique_ptr<MockGLES2Decoder> mock_decoder_;
+ std::unique_ptr<GLES2Decoder> decoder_;
MemoryTracker* memory_tracker_;
GLuint client_buffer_id_;
@@ -758,7 +760,7 @@
void SetupInitStateManualExpectations(bool es3_capable);
- scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_;
+ std::unique_ptr<::testing::StrictMock<MockCommandBufferEngine>> engine_;
GpuPreferences gpu_preferences_;
scoped_refptr<ContextGroup> group_;
MockGLStates gl_states_;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
index f021289..258d63d4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -8,6 +8,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -572,8 +574,8 @@
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1);
- scoped_ptr<int8_t[]> zero(new int8_t[unpadded_row_size]);
- scoped_ptr<int8_t[]> pack(new int8_t[kPackAlignment]);
+ std::unique_ptr<int8_t[]> zero(new int8_t[unpadded_row_size]);
+ std::unique_ptr<int8_t[]> pack(new int8_t[kPackAlignment]);
memset(zero.get(), kInitialMemoryValue, unpadded_row_size);
memset(pack.get(), kInitialMemoryValue, kPackAlignment);
for (GLint yy = 0; yy < in_read_height; ++yy) {
diff --git a/gpu/command_buffer/service/gpu_service_test.h b/gpu/command_buffer/service/gpu_service_test.h
index e547ff1..701eeb22 100644
--- a/gpu/command_buffer/service/gpu_service_test.h
+++ b/gpu/command_buffer/service/gpu_service_test.h
@@ -5,8 +5,9 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_
#define GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_
+#include <memory>
+
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,7 +32,7 @@
void TearDown() override;
gfx::GLContext* GetGLContext();
- scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
+ std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_;
private:
bool ran_setup_;
diff --git a/gpu/command_buffer/service/gpu_state_tracer.cc b/gpu/command_buffer/service/gpu_state_tracer.cc
index add3bf3..f26d3df 100644
--- a/gpu/command_buffer/service/gpu_state_tracer.cc
+++ b/gpu/command_buffer/service/gpu_state_tracer.cc
@@ -6,6 +6,7 @@
#include "base/base64.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "context_state.h"
#include "ui/gfx/codec/png_codec.h"
@@ -19,7 +20,7 @@
class Snapshot : public base::trace_event::ConvertableToTraceFormat {
public:
- static scoped_ptr<Snapshot> Create(const ContextState* state);
+ static std::unique_ptr<Snapshot> Create(const ContextState* state);
~Snapshot() override {}
@@ -44,8 +45,8 @@
Snapshot::Snapshot(const ContextState* state) : state_(state) {}
-scoped_ptr<Snapshot> Snapshot::Create(const ContextState* state) {
- return make_scoped_ptr(new Snapshot(state));
+std::unique_ptr<Snapshot> Snapshot::Create(const ContextState* state) {
+ return base::WrapUnique(new Snapshot(state));
}
bool Snapshot::SaveScreenshot(const gfx::Size& size) {
@@ -99,8 +100,9 @@
*out += "}";
}
-scoped_ptr<GPUStateTracer> GPUStateTracer::Create(const ContextState* state) {
- return scoped_ptr<GPUStateTracer>(new GPUStateTracer(state));
+std::unique_ptr<GPUStateTracer> GPUStateTracer::Create(
+ const ContextState* state) {
+ return std::unique_ptr<GPUStateTracer>(new GPUStateTracer(state));
}
GPUStateTracer::GPUStateTracer(const ContextState* state) : state_(state) {
@@ -117,7 +119,7 @@
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
"GPUStateTracer::TakeSnapshotWithCurrentFramebuffer");
- scoped_ptr<Snapshot> snapshot(Snapshot::Create(state_));
+ std::unique_ptr<Snapshot> snapshot(Snapshot::Create(state_));
// Only save a screenshot for now.
if (!snapshot->SaveScreenshot(size))
diff --git a/gpu/command_buffer/service/gpu_state_tracer.h b/gpu/command_buffer/service/gpu_state_tracer.h
index 1cb7fe92..09a873bd 100644
--- a/gpu/command_buffer/service/gpu_state_tracer.h
+++ b/gpu/command_buffer/service/gpu_state_tracer.h
@@ -5,8 +5,9 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_STATE_TRACER_H_
#define GPU_COMMAND_BUFFER_SERVICE_GPU_STATE_TRACER_H_
+#include <memory>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
namespace gfx {
class Size;
@@ -20,7 +21,7 @@
// Saves GPU state such as framebuffer contents while tracing.
class GPUStateTracer {
public:
- static scoped_ptr<GPUStateTracer> Create(const ContextState* state);
+ static std::unique_ptr<GPUStateTracer> Create(const ContextState* state);
~GPUStateTracer();
// Take a state snapshot with a screenshot of the currently bound framebuffer.
diff --git a/gpu/command_buffer/service/gpu_tracer.h b/gpu/command_buffer/service/gpu_tracer.h
index 41fd291..438c9cbb 100644
--- a/gpu/command_buffer/service/gpu_tracer.h
+++ b/gpu/command_buffer/service/gpu_tracer.h
@@ -9,12 +9,12 @@
#include <stdint.h>
#include <deque>
+#include <memory>
#include <stack>
#include <string>
#include <vector>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
@@ -193,7 +193,7 @@
const std::string category_;
const std::string name_;
scoped_refptr<Outputter> outputter_;
- scoped_ptr<gfx::GPUTimer> gpu_timer_;
+ std::unique_ptr<gfx::GPUTimer> gpu_timer_;
const bool service_enabled_ = false;
const bool device_enabled_ = false;
diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc
index 760818d1..16150742 100644
--- a/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -747,8 +747,8 @@
decoder_ = nullptr;
GpuServiceTest::TearDown();
}
- scoped_ptr<MockGLES2Decoder> decoder_;
- scoped_ptr<GPUTracerTester> tracer_tester_;
+ std::unique_ptr<MockGLES2Decoder> decoder_;
+ std::unique_ptr<GPUTracerTester> tracer_tester_;
};
TEST_F(GPUTracerTest, IsTracingTest) {
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index f58140f..11a8b121 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -85,7 +85,7 @@
GpuInProcessThreadHolder()
: sync_point_manager(new SyncPointManager(false)),
gpu_thread(new GpuInProcessThread(sync_point_manager.get())) {}
- scoped_ptr<SyncPointManager> sync_point_manager;
+ std::unique_ptr<SyncPointManager> sync_point_manager;
scoped_refptr<InProcessCommandBuffer::Service> gpu_thread;
};
@@ -327,7 +327,7 @@
transfer_buffer_manager_ = manager;
manager->Initialize();
- scoped_ptr<CommandBufferService> command_buffer(
+ std::unique_ptr<CommandBufferService> command_buffer(
new CommandBufferService(transfer_buffer_manager_.get()));
command_buffer->SetPutOffsetChangeCallback(base::Bind(
&InProcessCommandBuffer::PumpCommandsOnGpuThread, gpu_thread_weak_ptr_));
@@ -839,7 +839,7 @@
CheckSequencedThread();
DCHECK(gpu_memory_buffer_manager_);
- scoped_ptr<gfx::GpuMemoryBuffer> buffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> buffer(
gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer(
gfx::Size(width, height),
gpu::DefaultBufferFormatForImageFormat(internalformat),
@@ -1014,7 +1014,7 @@
}
}
-void RunOnTargetThread(scoped_ptr<base::Closure> callback) {
+void RunOnTargetThread(std::unique_ptr<base::Closure> callback) {
DCHECK(callback.get());
callback->Run();
}
@@ -1025,7 +1025,7 @@
const base::Closure& callback) {
// Make sure the callback gets deleted on the target thread by passing
// ownership.
- scoped_ptr<base::Closure> scoped_callback(new base::Closure(callback));
+ std::unique_ptr<base::Closure> scoped_callback(new base::Closure(callback));
base::Closure callback_on_client_thread =
base::Bind(&RunOnTargetThread, base::Passed(&scoped_callback));
base::Closure wrapped_callback =
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index a5f7824..a022db25 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <vector>
#include "base/atomic_sequence_num.h"
@@ -17,7 +18,6 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h"
@@ -169,7 +169,7 @@
scoped_refptr<gles2::MailboxManager> mailbox_manager_;
scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_;
scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_;
- scoped_ptr<gpu::gles2::ProgramCache> program_cache_;
+ std::unique_ptr<gpu::gles2::ProgramCache> program_cache_;
};
private:
@@ -242,12 +242,12 @@
// creation):
scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_;
scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<CommandExecutor> executor_;
- scoped_ptr<gles2::GLES2Decoder> decoder_;
+ std::unique_ptr<CommandExecutor> executor_;
+ std::unique_ptr<gles2::GLES2Decoder> decoder_;
scoped_refptr<gfx::GLContext> context_;
scoped_refptr<gfx::GLSurface> surface_;
scoped_refptr<SyncPointOrderData> sync_point_order_data_;
- scoped_ptr<SyncPointClient> sync_point_client_;
+ std::unique_ptr<SyncPointClient> sync_point_client_;
base::Closure context_lost_callback_;
// Used to throttle PerformDelayedWorkOnGpuThread.
bool delayed_work_pending_;
@@ -267,7 +267,7 @@
uint64_t flushed_fence_sync_release_;
// Accessed on both threads:
- scoped_ptr<CommandBufferServiceBase> command_buffer_;
+ std::unique_ptr<CommandBufferServiceBase> command_buffer_;
base::Lock command_buffer_lock_;
base::WaitableEvent flush_event_;
scoped_refptr<Service> service_;
@@ -278,7 +278,7 @@
// Only used with explicit scheduling and the gpu thread is the same as
// the client thread.
- scoped_ptr<base::SequenceChecker> sequence_checker_;
+ std::unique_ptr<base::SequenceChecker> sequence_checker_;
base::WeakPtr<InProcessCommandBuffer> client_thread_weak_ptr_;
base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_;
diff --git a/gpu/command_buffer/service/memory_program_cache.cc b/gpu/command_buffer/service/memory_program_cache.cc
index ced200d5..4cd3fd2e 100644
--- a/gpu/command_buffer/service/memory_program_cache.cc
+++ b/gpu/command_buffer/service/memory_program_cache.cc
@@ -214,7 +214,7 @@
shader_b->set_output_variable_list(value->output_variable_list_1());
if (!shader_callback.is_null() && !disable_gpu_shader_disk_cache_) {
- scoped_ptr<GpuProgramProto> proto(
+ std::unique_ptr<GpuProgramProto> proto(
GpuProgramProto::default_instance().New());
proto->set_sha(sha, kHashLength);
proto->set_format(value->format());
@@ -242,7 +242,7 @@
if (length == 0 || static_cast<unsigned int>(length) > max_size_bytes_) {
return;
}
- scoped_ptr<char[]> binary(new char[length]);
+ std::unique_ptr<char[]> binary(new char[length]);
glGetProgramBinary(program,
length,
NULL,
@@ -283,7 +283,7 @@
}
if (!shader_callback.is_null() && !disable_gpu_shader_disk_cache_) {
- scoped_ptr<GpuProgramProto> proto(
+ std::unique_ptr<GpuProgramProto> proto(
GpuProgramProto::default_instance().New());
proto->set_sha(sha, kHashLength);
proto->set_format(format);
@@ -308,7 +308,8 @@
}
void MemoryProgramCache::LoadProgram(const std::string& program) {
- scoped_ptr<GpuProgramProto> proto(GpuProgramProto::default_instance().New());
+ std::unique_ptr<GpuProgramProto> proto(
+ GpuProgramProto::default_instance().New());
if (proto->ParseFromString(program)) {
AttributeMap vertex_attribs;
UniformMap vertex_uniforms;
@@ -353,7 +354,7 @@
&fragment_output_variables);
}
- scoped_ptr<char[]> binary(new char[proto->program().length()]);
+ std::unique_ptr<char[]> binary(new char[proto->program().length()]);
memcpy(binary.get(), proto->program().c_str(), proto->program().length());
store_.Put(
diff --git a/gpu/command_buffer/service/memory_program_cache.h b/gpu/command_buffer/service/memory_program_cache.h
index 14d3ac0..6710c1c 100644
--- a/gpu/command_buffer/service/memory_program_cache.h
+++ b/gpu/command_buffer/service/memory_program_cache.h
@@ -8,13 +8,13 @@
#include <stddef.h>
#include <map>
+#include <memory>
#include <string>
#include "base/containers/hash_tables.h"
#include "base/containers/mru_cache.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/program_cache.h"
@@ -130,7 +130,7 @@
const GLsizei length_;
const GLenum format_;
- const scoped_ptr<const char[]> data_;
+ const std::unique_ptr<const char[]> data_;
const std::string program_hash_;
const std::string shader_0_hash_;
const AttributeMap attrib_map_0_;
diff --git a/gpu/command_buffer/service/memory_program_cache_unittest.cc b/gpu/command_buffer/service/memory_program_cache_unittest.cc
index 7662942..a4a78c62 100644
--- a/gpu/command_buffer/service/memory_program_cache_unittest.cc
+++ b/gpu/command_buffer/service/memory_program_cache_unittest.cc
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/service/gl_utils.h"
@@ -182,7 +184,7 @@
.WillOnce(SetArgPointee<2>(GL_FALSE));
}
- scoped_ptr<MemoryProgramCache> cache_;
+ std::unique_ptr<MemoryProgramCache> cache_;
ShaderManager shader_manager_;
Shader* vertex_shader_;
Shader* fragment_shader_;
@@ -560,8 +562,8 @@
fragment_shader_->set_source("al sdfkjdk");
TestHelper::SetShaderStates(gl_.get(), fragment_shader_, true);
- scoped_ptr<char[]> bigTestBinary =
- scoped_ptr<char[]>(new char[kEvictingBinaryLength]);
+ std::unique_ptr<char[]> bigTestBinary =
+ std::unique_ptr<char[]>(new char[kEvictingBinaryLength]);
for (size_t i = 0; i < kEvictingBinaryLength; ++i) {
bigTestBinary[i] = i % 250;
}
diff --git a/gpu/command_buffer/service/path_manager_unittest.cc b/gpu/command_buffer/service/path_manager_unittest.cc
index 8a20db5b..236a74d7 100644
--- a/gpu/command_buffer/service/path_manager_unittest.cc
+++ b/gpu/command_buffer/service/path_manager_unittest.cc
@@ -4,7 +4,8 @@
#include "gpu/command_buffer/service/path_manager.h"
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/mocks.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -29,7 +30,7 @@
GpuServiceTest::TearDown();
}
- scoped_ptr<PathManager> manager_;
+ std::unique_ptr<PathManager> manager_;
};
TEST_F(PathManagerTest, Basic) {
diff --git a/gpu/command_buffer/service/program_cache.cc b/gpu/command_buffer/service/program_cache.cc
index 56c84b86..b542f18 100644
--- a/gpu/command_buffer/service/program_cache.cc
+++ b/gpu/command_buffer/service/program_cache.cc
@@ -6,8 +6,9 @@
#include <stddef.h>
+#include <memory>
#include <string>
-#include "base/memory/scoped_ptr.h"
+
#include "gpu/command_buffer/service/shader_manager.h"
#include "third_party/angle/src/common/version.h"
@@ -123,7 +124,7 @@
const size_t total_size = shader0_size + shader1_size + angle_commit_size
+ map_size + var_size + sizeof(transform_feedback_buffer_mode);
- scoped_ptr<unsigned char[]> buffer(new unsigned char[total_size]);
+ std::unique_ptr<unsigned char[]> buffer(new unsigned char[total_size]);
memcpy(buffer.get(), hashed_shader_0, shader0_size);
memcpy(&buffer[shader0_size], hashed_shader_1, shader1_size);
size_t current_pos = shader0_size + shader1_size;
diff --git a/gpu/command_buffer/service/program_cache_unittest.cc b/gpu/command_buffer/service/program_cache_unittest.cc
index f4949ce..6cb32bc9 100644
--- a/gpu/command_buffer/service/program_cache_unittest.cc
+++ b/gpu/command_buffer/service/program_cache_unittest.cc
@@ -4,7 +4,8 @@
#include "gpu/command_buffer/service/program_cache.h"
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/command_buffer/service/mocks.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -91,7 +92,7 @@
cache_(new NoBackendProgramCache()) { }
protected:
- scoped_ptr<NoBackendProgramCache> cache_;
+ std::unique_ptr<NoBackendProgramCache> cache_;
std::vector<std::string> varyings_;
};
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index 91d4991..2ff07c5 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include <set>
#include <utility>
#include <vector>
@@ -15,7 +16,6 @@
#include "base/command_line.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_number_conversions.h"
@@ -320,7 +320,7 @@
set_log_info(NULL);
return;
}
- scoped_ptr<char[]> temp(new char[max_len]);
+ std::unique_ptr<char[]> temp(new char[max_len]);
GLint len = 0;
glGetProgramInfoLog(service_id_, max_len, &len, temp.get());
DCHECK(max_len == 0 || len < max_len);
@@ -464,7 +464,7 @@
glGetProgramiv(service_id_, GL_ACTIVE_ATTRIBUTES, &num_attribs);
glGetProgramiv(service_id_, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_len);
// TODO(gman): Should we check for error?
- scoped_ptr<char[]> name_buffer(new char[max_len]);
+ std::unique_ptr<char[]> name_buffer(new char[max_len]);
for (GLint ii = 0; ii < num_attribs; ++ii) {
GLsizei length = 0;
GLsizei size = 0;
@@ -552,7 +552,7 @@
glGetProgramiv(service_id_, GL_ACTIVE_UNIFORM_MAX_LENGTH,
&name_buffer_length);
DCHECK(name_buffer_length > 0);
- scoped_ptr<char[]> name_buffer(new char[name_buffer_length]);
+ std::unique_ptr<char[]> name_buffer(new char[name_buffer_length]);
size_t unused_client_location_cursor = 0;
@@ -726,7 +726,7 @@
&max_len);
DCHECK(max_len > 0);
- scoped_ptr<char[]> name_buffer(new char[max_len]);
+ std::unique_ptr<char[]> name_buffer(new char[max_len]);
Shader* fragment_shader =
attached_shaders_[ShaderTypeToIndex(GL_FRAGMENT_SHADER)].get();
@@ -1787,7 +1787,7 @@
if (combined_map.size() == 0)
return true;
- scoped_ptr<ShVariableInfo[]> variables(
+ std::unique_ptr<ShVariableInfo[]> variables(
new ShVariableInfo[combined_map.size()]);
size_t index = 0;
for (const auto& key_value : combined_map) {
diff --git a/gpu/command_buffer/service/program_manager.h b/gpu/command_buffer/service/program_manager.h
index 1d0c991..05072de 100644
--- a/gpu/command_buffer/service/program_manager.h
+++ b/gpu/command_buffer/service/program_manager.h
@@ -9,8 +9,10 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <string>
#include <vector>
+
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -506,7 +508,7 @@
bool uniforms_cleared_;
// Log info
- scoped_ptr<std::string> log_info_;
+ std::unique_ptr<std::string> log_info_;
// attribute-location binding map from glBindAttribLocation() calls.
LocationMap bind_attrib_location_map_;
diff --git a/gpu/command_buffer/service/program_manager_unittest.cc b/gpu/command_buffer/service/program_manager_unittest.cc
index 088342b..5fcb3dc 100644
--- a/gpu/command_buffer/service/program_manager_unittest.cc
+++ b/gpu/command_buffer/service/program_manager_unittest.cc
@@ -8,9 +8,9 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include "base/command_line.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -86,7 +86,7 @@
GpuServiceTest::TearDown();
}
- scoped_ptr<ProgramManager> manager_;
+ std::unique_ptr<ProgramManager> manager_;
GpuPreferences gpu_preferences_;
scoped_refptr<FeatureInfo> feature_info_;
};
@@ -2118,7 +2118,7 @@
.Times(1);
}
- scoped_ptr<MockProgramCache> cache_;
+ std::unique_ptr<MockProgramCache> cache_;
Shader* vertex_shader_;
Shader* fragment_shader_;
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index c2cd4ec..5d86dcf 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -479,7 +479,7 @@
~CommandsCompletedQuery() override;
private:
- scoped_ptr<gfx::GLFence> fence_;
+ std::unique_ptr<gfx::GLFence> fence_;
base::TimeTicks begin_time_;
};
@@ -559,7 +559,7 @@
~TimeElapsedQuery() override;
private:
- scoped_ptr<gfx::GPUTimer> gpu_timer_;
+ std::unique_ptr<gfx::GPUTimer> gpu_timer_;
};
TimeElapsedQuery::TimeElapsedQuery(QueryManager* manager,
@@ -636,7 +636,7 @@
~TimeStampQuery() override;
private:
- scoped_ptr<gfx::GPUTimer> gpu_timer_;
+ std::unique_ptr<gfx::GPUTimer> gpu_timer_;
};
TimeStampQuery::TimeStampQuery(QueryManager* manager,
@@ -809,7 +809,7 @@
return query.get();
}
-scoped_ptr<gfx::GPUTimer> QueryManager::CreateGPUTimer(bool elapsed_time) {
+std::unique_ptr<gfx::GPUTimer> QueryManager::CreateGPUTimer(bool elapsed_time) {
return gpu_timing_client_->CreateGPUTimer(elapsed_time);
}
diff --git a/gpu/command_buffer/service/query_manager.h b/gpu/command_buffer/service/query_manager.h
index f9f6816a..f09339b 100644
--- a/gpu/command_buffer/service/query_manager.h
+++ b/gpu/command_buffer/service/query_manager.h
@@ -8,13 +8,14 @@
#include <stdint.h>
#include <deque>
+#include <memory>
#include <vector>
+
#include "base/atomicops.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/gpu_export.h"
@@ -261,7 +262,7 @@
return decoder_;
}
- scoped_ptr<gfx::GPUTimer> CreateGPUTimer(bool elapsed_time);
+ std::unique_ptr<gfx::GPUTimer> CreateGPUTimer(bool elapsed_time);
bool GPUTimingAvailable();
void GenQueries(GLsizei n, const GLuint* queries);
diff --git a/gpu/command_buffer/service/query_manager_unittest.cc b/gpu/command_buffer/service/query_manager_unittest.cc
index 8f61ff2..351f9b0 100644
--- a/gpu/command_buffer/service/query_manager_unittest.cc
+++ b/gpu/command_buffer/service/query_manager_unittest.cc
@@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/error_state_mock.h"
@@ -97,19 +99,21 @@
EXPECT_TRUE(manager_->EndQuery(query, submit_count));
}
- scoped_ptr<MockGLES2Decoder> decoder_;
- scoped_ptr<QueryManager> manager_;
+ std::unique_ptr<MockGLES2Decoder> decoder_;
+ std::unique_ptr<QueryManager> manager_;
private:
class MockCommandBufferEngine : public CommandBufferEngine {
public:
MockCommandBufferEngine() {
- scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shared_memory(
+ new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kSharedBufferSize);
valid_buffer_ = MakeBufferFromSharedMemory(std::move(shared_memory),
kSharedBufferSize);
- scoped_ptr<base::SharedMemory> shared_memory2(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shared_memory2(
+ new base::SharedMemory());
shared_memory2->CreateAndMapAnonymous(kSharedBufferSize);
valid_buffer2_ = MakeBufferFromSharedMemory(std::move(shared_memory2),
kSharedBufferSize);
@@ -157,7 +161,7 @@
scoped_refptr<gpu::Buffer> invalid_buffer_;
};
- scoped_ptr<MockCommandBufferEngine> engine_;
+ std::unique_ptr<MockCommandBufferEngine> engine_;
};
class QueryManagerManualSetupTest : public QueryManagerTest {
@@ -510,7 +514,7 @@
"GL_ARB_occlusion_query2");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
feature_info->InitializeForTesting();
- scoped_ptr<QueryManager> manager(
+ std::unique_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
EXPECT_CALL(*gl_, GenQueries(1, _))
@@ -544,7 +548,7 @@
"GL_ARB_occlusion_query");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
feature_info->InitializeForTesting();
- scoped_ptr<QueryManager> manager(
+ std::unique_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
EXPECT_CALL(*gl_, GenQueries(1, _))
@@ -577,7 +581,7 @@
"GL_ARB_occlusion_query");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
feature_info->InitializeForTesting();
- scoped_ptr<QueryManager> manager(
+ std::unique_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
EXPECT_CALL(*gl_, GenQueries(1, _))
@@ -920,7 +924,7 @@
TestHelper::SetupFeatureInfoInitExpectations(gl_.get(), "");
scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
feature_info->InitializeForTesting();
- scoped_ptr<QueryManager> manager(
+ std::unique_ptr<QueryManager> manager(
new QueryManager(decoder_.get(), feature_info.get()));
QueryManager::Query* query = manager->CreateQuery(
diff --git a/gpu/command_buffer/service/renderbuffer_manager.h b/gpu/command_buffer/service/renderbuffer_manager.h
index d44b576..f808e96 100644
--- a/gpu/command_buffer/service/renderbuffer_manager.h
+++ b/gpu/command_buffer/service/renderbuffer_manager.h
@@ -8,11 +8,12 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
+
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/gpu_export.h"
@@ -187,7 +188,7 @@
void StartTracking(Renderbuffer* renderbuffer);
void StopTracking(Renderbuffer* renderbuffer);
- scoped_ptr<MemoryTypeTracker> memory_type_tracker_;
+ std::unique_ptr<MemoryTypeTracker> memory_type_tracker_;
MemoryTracker* memory_tracker_;
GLint max_renderbuffer_size_;
diff --git a/gpu/command_buffer/service/renderbuffer_manager_unittest.cc b/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
index 815d8ee..a027183 100644
--- a/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
@@ -49,7 +49,7 @@
}
scoped_refptr<FeatureInfo> feature_info_;
- scoped_ptr<RenderbufferManager> manager_;
+ std::unique_ptr<RenderbufferManager> manager_;
};
class RenderbufferManagerTest : public RenderbufferManagerTestBase {
diff --git a/gpu/command_buffer/service/sampler_manager.h b/gpu/command_buffer/service/sampler_manager.h
index 6dc470a..8d85343 100644
--- a/gpu/command_buffer/service/sampler_manager.h
+++ b/gpu/command_buffer/service/sampler_manager.h
@@ -6,11 +6,11 @@
#define GPU_COMMAND_BUFFER_SERVICE_SAMPLER_MANAGER_H_
#include <vector>
+
#include "base/containers/hash_tables.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/shader_manager.h b/gpu/command_buffer/service/shader_manager.h
index 31a86e8..69e0cd6 100644
--- a/gpu/command_buffer/service/shader_manager.h
+++ b/gpu/command_buffer/service/shader_manager.h
@@ -6,11 +6,11 @@
#define GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_
#include <string>
+
#include "base/containers/hash_tables.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/shader_translator.h"
#include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc
index 93471ec10..1aef056 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -4,7 +4,6 @@
#include "gpu/command_buffer/service/shader_manager.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/mocks.h"
#include "gpu/command_buffer/service/test_helper.h"
diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h
index 04b1206..ac8d6f8 100644
--- a/gpu/command_buffer/service/shader_translator.h
+++ b/gpu/command_buffer/service/shader_translator.h
@@ -10,7 +10,6 @@
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "gpu/gpu_export.h"
#include "third_party/angle/include/GLSLANG/ShaderLang.h"
diff --git a/gpu/command_buffer/service/sync_point_manager.cc b/gpu/command_buffer/service/sync_point_manager.cc
index 2adf5df..9669bb6 100644
--- a/gpu/command_buffer/service/sync_point_manager.cc
+++ b/gpu/command_buffer/service/sync_point_manager.cc
@@ -14,6 +14,7 @@
#include "base/containers/hash_tables.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/rand_util.h"
#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
@@ -370,7 +371,7 @@
}
}
-scoped_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient(
+std::unique_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient(
scoped_refptr<SyncPointOrderData> order_data,
CommandBufferNamespace namespace_id,
CommandBufferId client_id) {
@@ -384,11 +385,12 @@
namespace_id, client_id)));
DCHECK(result.second);
- return make_scoped_ptr(result.first->second);
+ return base::WrapUnique(result.first->second);
}
-scoped_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClientWaiter() {
- return make_scoped_ptr(new SyncPointClient);
+std::unique_ptr<SyncPointClient>
+SyncPointManager::CreateSyncPointClientWaiter() {
+ return base::WrapUnique(new SyncPointClient);
}
scoped_refptr<SyncPointClientState> SyncPointManager::GetSyncPointClientState(
diff --git a/gpu/command_buffer/service/sync_point_manager.h b/gpu/command_buffer/service/sync_point_manager.h
index 49769fb..a004a37 100644
--- a/gpu/command_buffer/service/sync_point_manager.h
+++ b/gpu/command_buffer/service/sync_point_manager.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <functional>
+#include <memory>
#include <queue>
#include <unordered_map>
#include <vector>
@@ -17,7 +18,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
@@ -291,14 +291,14 @@
~SyncPointManager();
// Creates/Destroy a sync point client which message processors should hold.
- scoped_ptr<SyncPointClient> CreateSyncPointClient(
+ std::unique_ptr<SyncPointClient> CreateSyncPointClient(
scoped_refptr<SyncPointOrderData> order_data,
CommandBufferNamespace namespace_id,
CommandBufferId client_id);
// Creates a sync point client which cannot process order numbers but can only
// Wait out of order.
- scoped_ptr<SyncPointClient> CreateSyncPointClientWaiter();
+ std::unique_ptr<SyncPointClient> CreateSyncPointClientWaiter();
// Finds the state of an already created sync point client.
scoped_refptr<SyncPointClientState> GetSyncPointClientState(
diff --git a/gpu/command_buffer/service/sync_point_manager_unittest.cc b/gpu/command_buffer/service/sync_point_manager_unittest.cc
index e6cdeeaa..52371a5 100644
--- a/gpu/command_buffer/service/sync_point_manager_unittest.cc
+++ b/gpu/command_buffer/service/sync_point_manager_unittest.cc
@@ -4,6 +4,7 @@
#include <stdint.h>
+#include <memory>
#include <queue>
#include "base/bind.h"
@@ -37,12 +38,12 @@
*client_id_ptr = client_id;
}
- scoped_ptr<SyncPointManager> sync_point_manager_;
+ std::unique_ptr<SyncPointManager> sync_point_manager_;
};
struct SyncPointStream {
scoped_refptr<SyncPointOrderData> order_data;
- scoped_ptr<SyncPointClient> client;
+ std::unique_ptr<SyncPointClient> client;
std::queue<uint32_t> order_numbers;
SyncPointStream(SyncPointManager* sync_point_manager,
@@ -120,7 +121,7 @@
scoped_refptr<SyncPointOrderData> order_data = SyncPointOrderData::Create();
- scoped_ptr<SyncPointClient> client =
+ std::unique_ptr<SyncPointClient> client =
sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId,
kBufferId);
@@ -136,7 +137,7 @@
const CommandBufferId kBufferId = CommandBufferId::FromUnsafeValue(0x123);
scoped_refptr<SyncPointOrderData> order_data = SyncPointOrderData::Create();
- scoped_ptr<SyncPointClient> client =
+ std::unique_ptr<SyncPointClient> client =
sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId,
kBufferId);
scoped_refptr<SyncPointClientState> client_state = client->client_state();
@@ -161,10 +162,10 @@
const CommandBufferId kBufferId2 = CommandBufferId::FromUnsafeValue(0x234);
scoped_refptr<SyncPointOrderData> order_data = SyncPointOrderData::Create();
- scoped_ptr<SyncPointClient> client1 =
+ std::unique_ptr<SyncPointClient> client1 =
sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId,
kBufferId1);
- scoped_ptr<SyncPointClient> client2 =
+ std::unique_ptr<SyncPointClient> client2 =
sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId,
kBufferId2);
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index f8346c033..44bf4ed 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -10,7 +10,6 @@
#include "base/lazy_instance.h"
#include "base/memory/linked_ptr.h"
-#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_local.h"
// gl_stream_texture_image.h is included to work around crbug.com/595189, a
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 97f3843..b904fc9 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -2359,7 +2359,7 @@
return;
}
DoTexImageArguments new_args = args;
- scoped_ptr<char[]> zero(new char[args.pixels_size]);
+ std::unique_ptr<char[]> zero(new char[args.pixels_size]);
memset(zero.get(), 0, args.pixels_size);
for (GLenum face : undefined_faces) {
new_args.target = face;
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index 7fbdeb1..e56549b 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -10,9 +10,11 @@
#include <algorithm>
#include <list>
+#include <memory>
#include <set>
#include <string>
#include <vector>
+
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -1094,7 +1096,7 @@
TextureRef* ref);
MemoryTypeTracker* GetMemTracker();
- scoped_ptr<MemoryTypeTracker> memory_type_tracker_;
+ std::unique_ptr<MemoryTypeTracker> memory_type_tracker_;
MemoryTracker* memory_tracker_;
scoped_refptr<FeatureInfo> feature_info_;
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index 75d2dc66..f430ce0 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -7,11 +7,11 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <utility>
#include "base/command_line.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/error_state_mock.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/framebuffer_manager.h"
@@ -124,8 +124,8 @@
}
scoped_refptr<FeatureInfo> feature_info_;
- scoped_ptr<TextureManager> manager_;
- scoped_ptr<MockErrorState> error_state_;
+ std::unique_ptr<TextureManager> manager_;
+ std::unique_ptr<MockErrorState> error_state_;
};
// GCC requires these declarations, but MSVC requires they not be present
@@ -762,10 +762,10 @@
texture_ref, pname, value, error);
}
- scoped_ptr<MockGLES2Decoder> decoder_;
- scoped_ptr<MockErrorState> error_state_;
+ std::unique_ptr<MockGLES2Decoder> decoder_;
+ std::unique_ptr<MockErrorState> error_state_;
scoped_refptr<FeatureInfo> feature_info_;
- scoped_ptr<TextureManager> manager_;
+ std::unique_ptr<TextureManager> manager_;
scoped_refptr<TextureRef> texture_ref_;
};
@@ -2196,9 +2196,9 @@
protected:
scoped_refptr<FeatureInfo> feature_info_;
scoped_refptr<CountingMemoryTracker> memory_tracker1_;
- scoped_ptr<TextureManager> texture_manager1_;
+ std::unique_ptr<TextureManager> texture_manager1_;
scoped_refptr<CountingMemoryTracker> memory_tracker2_;
- scoped_ptr<TextureManager> texture_manager2_;
+ std::unique_ptr<TextureManager> texture_manager2_;
};
TEST_F(SharedTextureTest, DeleteTextures) {
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc
index f9db75e..2e1e8b3 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -7,9 +7,9 @@
#include <stdint.h>
#include <limits>
+#include <memory>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/process/process_handle.h"
#include "base/strings/stringprintf.h"
#include "base/thread_task_runner_handle.h"
@@ -58,7 +58,7 @@
bool TransferBufferManager::RegisterTransferBuffer(
int32_t id,
- scoped_ptr<BufferBacking> buffer_backing) {
+ std::unique_ptr<BufferBacking> buffer_backing) {
if (id <= 0) {
DVLOG(0) << "Cannot register transfer buffer with non-positive ID.";
return false;
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.h b/gpu/command_buffer/service/transfer_buffer_manager.h
index 8843160..31489785 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.h
+++ b/gpu/command_buffer/service/transfer_buffer_manager.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <set>
#include <vector>
@@ -26,8 +27,9 @@
class GPU_EXPORT TransferBufferManagerInterface :
public base::RefCounted<TransferBufferManagerInterface> {
public:
- virtual bool RegisterTransferBuffer(int32_t id,
- scoped_ptr<BufferBacking> buffer) = 0;
+ virtual bool RegisterTransferBuffer(
+ int32_t id,
+ std::unique_ptr<BufferBacking> buffer) = 0;
virtual void DestroyTransferBuffer(int32_t id) = 0;
virtual scoped_refptr<Buffer> GetTransferBuffer(int32_t id) = 0;
@@ -50,7 +52,7 @@
bool Initialize();
bool RegisterTransferBuffer(
int32_t id,
- scoped_ptr<BufferBacking> buffer_backing) override;
+ std::unique_ptr<BufferBacking> buffer_backing) override;
void DestroyTransferBuffer(int32_t id) override;
scoped_refptr<Buffer> GetTransferBuffer(int32_t id) override;
diff --git a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
index 56edaed..1e12ae68 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
@@ -6,7 +6,8 @@
#include <stddef.h>
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,10 +41,10 @@
}
TEST_F(TransferBufferManagerTest, CanRegisterTransferBuffer) {
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory());
shm->CreateAndMapAnonymous(kBufferSize);
base::SharedMemory* shm_raw_pointer = shm.get();
- scoped_ptr<SharedMemoryBufferBacking> backing(
+ std::unique_ptr<SharedMemoryBufferBacking> backing(
new SharedMemoryBufferBacking(std::move(shm), kBufferSize));
SharedMemoryBufferBacking* backing_raw_ptr = backing.get();
@@ -63,14 +64,14 @@
return reinterpret_cast<void*>(0xBADF00D0);
}
size_t GetSize() const override { return 42; }
- static scoped_ptr<BufferBacking> Make() {
- return scoped_ptr<BufferBacking>(new FakeBufferBacking);
+ static std::unique_ptr<BufferBacking> Make() {
+ return std::unique_ptr<BufferBacking>(new FakeBufferBacking);
}
};
TEST_F(TransferBufferManagerTest, CanDestroyTransferBuffer) {
EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, scoped_ptr<BufferBacking>(new FakeBufferBacking)));
+ 1, std::unique_ptr<BufferBacking>(new FakeBufferBacking)));
transfer_buffer_manager_->DestroyTransferBuffer(1);
scoped_refptr<Buffer> registered =
transfer_buffer_manager_->GetTransferBuffer(1);
@@ -106,7 +107,7 @@
}
TEST_F(TransferBufferManagerTest, CannotRegisterNegativeTransferBufferId) {
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory());
shm->CreateAndMapAnonymous(kBufferSize);
EXPECT_FALSE(transfer_buffer_manager_->RegisterTransferBuffer(
-1, FakeBufferBacking::Make()));
diff --git a/gpu/command_buffer/service/valuebuffer_manager.h b/gpu/command_buffer/service/valuebuffer_manager.h
index 0d6782d..04a3304 100644
--- a/gpu/command_buffer/service/valuebuffer_manager.h
+++ b/gpu/command_buffer/service/valuebuffer_manager.h
@@ -10,7 +10,6 @@
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "gpu/command_buffer/common/value_state.h"
#include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/valuebuffer_manager_unittest.cc b/gpu/command_buffer/service/valuebuffer_manager_unittest.cc
index c5d0c6c..a4d9601 100644
--- a/gpu/command_buffer/service/valuebuffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/valuebuffer_manager_unittest.cc
@@ -4,7 +4,8 @@
#include "gpu/command_buffer/service/valuebuffer_manager.h"
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -54,7 +55,7 @@
scoped_refptr<SubscriptionRefSet> subscription_ref_set_;
scoped_refptr<ValueStateMap> pending_state_map_;
- scoped_ptr<ValuebufferManager> manager_;
+ std::unique_ptr<ValuebufferManager> manager_;
};
TEST_F(ValuebufferManagerTest, Basic) {
diff --git a/gpu/command_buffer/service/vertex_array_manager.h b/gpu/command_buffer/service/vertex_array_manager.h
index 2c526881..8221f30 100644
--- a/gpu/command_buffer/service/vertex_array_manager.h
+++ b/gpu/command_buffer/service/vertex_array_manager.h
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/vertex_array_manager_unittest.cc b/gpu/command_buffer/service/vertex_array_manager_unittest.cc
index 73f9bc7..a679cb5b 100644
--- a/gpu/command_buffer/service/vertex_array_manager_unittest.cc
+++ b/gpu/command_buffer/service/vertex_array_manager_unittest.cc
@@ -4,10 +4,11 @@
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/service/vertex_array_manager.h"
#include "gpu/command_buffer/service/vertex_attrib_manager.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gpu_service_test.h"
#include "gpu/command_buffer/service/test_helper.h"
@@ -40,7 +41,7 @@
GpuServiceTest::TearDown();
}
- scoped_ptr<VertexArrayManager> manager_;
+ std::unique_ptr<VertexArrayManager> manager_;
};
// GCC requires these declarations, but MSVC requires they not be present
diff --git a/gpu/command_buffer/service/vertex_attrib_manager.cc b/gpu/command_buffer/service/vertex_attrib_manager.cc
index 7ec12e8..76883dc 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager.cc
+++ b/gpu/command_buffer/service/vertex_attrib_manager.cc
@@ -9,7 +9,6 @@
#include <list>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
diff --git a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
index 2e31c16..be76444 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
+++ b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
@@ -6,7 +6,6 @@
#include <stdint.h>
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/error_state_mock.h"
#include "gpu/command_buffer/service/feature_info.h"
diff --git a/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc b/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc
index 7c5d8e2..4a84ab9f 100644
--- a/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc
+++ b/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc
@@ -8,6 +8,8 @@
#include <stdint.h>
#include <string.h>
+#include <memory>
+
#include "base/command_line.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/tests/gl_manager.h"
@@ -173,7 +175,7 @@
}
static const float kBlue[] = {0.0f, 0.0f, 1.0f, 1.0f};
static const float kGreen[] = {0.0f, 1.0f, 0.0f, 1.0f};
- scoped_ptr<uint8_t[]> results[3];
+ std::unique_ptr<uint8_t[]> results[3];
const GLint kResultSize = kWidth * kHeight * 4;
for (int pass = 0; pass < 3; ++pass) {
@@ -213,7 +215,7 @@
static const float kBlue[] = {0.0f, 0.0f, 1.0f, 1.0f};
static const float kGreen[] = {0.0f, 1.0f, 0.0f, 1.0f};
- scoped_ptr<uint8_t[]> results[3];
+ std::unique_ptr<uint8_t[]> results[3];
const GLint kResultSize = kWidth * kHeight * 4;
for (int pass = 0; pass < 3; ++pass) {
diff --git a/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc b/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc
index 0543058..1ac777b1 100644
--- a/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc
+++ b/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc
@@ -11,6 +11,9 @@
#include <GLES2/gl2extchromium.h>
#include <stdint.h>
+#include <memory>
+
+#include "base/memory/ptr_util.h"
#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -161,37 +164,30 @@
Image(const GLint format, const uint8_t* data, const GLsizei data_size)
: format(format), data(data), data_size(data_size) {}
};
- std::vector<scoped_ptr<Image>> supported_formats;
+ std::vector<std::unique_ptr<Image>> supported_formats;
if (GLTestHelper::HasExtension("GL_AMD_compressed_ATC_texture") ||
GLTestHelper::HasExtension("GL_ATI_texture_compression_atitc")) {
- supported_formats.push_back(make_scoped_ptr(new Image(
- GL_ATC_RGB_AMD,
- kCompressedImageATC,
- sizeof(kCompressedImageATC))));
- supported_formats.push_back(make_scoped_ptr(new Image(
- GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD,
- kCompressedImageATCIA,
- sizeof(kCompressedImageATCIA))));
+ supported_formats.push_back(base::WrapUnique(new Image(
+ GL_ATC_RGB_AMD, kCompressedImageATC, sizeof(kCompressedImageATC))));
+ supported_formats.push_back(base::WrapUnique(
+ new Image(GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, kCompressedImageATCIA,
+ sizeof(kCompressedImageATCIA))));
}
if (GLTestHelper::HasExtension("GL_EXT_texture_compression_dxt1")) {
- supported_formats.push_back(make_scoped_ptr(new Image(
- GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
- kCompressedImageDXT1,
- sizeof(kCompressedImageDXT1))));
+ supported_formats.push_back(base::WrapUnique(
+ new Image(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, kCompressedImageDXT1,
+ sizeof(kCompressedImageDXT1))));
}
if (GLTestHelper::HasExtension("GL_ANGLE_texture_compression_dxt5") ||
GLTestHelper::HasExtension("GL_EXT_texture_compression_s3tc")) {
- supported_formats.push_back(make_scoped_ptr(new Image(
- GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
- kCompressedImageDXT5,
- sizeof(kCompressedImageDXT5))));
+ supported_formats.push_back(base::WrapUnique(
+ new Image(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, kCompressedImageDXT5,
+ sizeof(kCompressedImageDXT5))));
}
if (GLTestHelper::HasExtension("GL_OES_compressed_ETC1_RGB8_texture")) {
- supported_formats.push_back(make_scoped_ptr(new Image(
- GL_ETC1_RGB8_OES,
- kCompressedImageETC1,
- sizeof(kCompressedImageETC1))));
+ supported_formats.push_back(base::WrapUnique(new Image(
+ GL_ETC1_RGB8_OES, kCompressedImageETC1, sizeof(kCompressedImageETC1))));
}
for (const auto& image : supported_formats) {
diff --git a/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc b/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc
index 3979a326..96d0e463 100644
--- a/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc
+++ b/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc
@@ -5,6 +5,8 @@
#include <GLES2/gl2.h>
#include <stdint.h>
+#include <memory>
+
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "gpu/command_buffer/tests/gl_manager.h"
@@ -135,7 +137,7 @@
EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT),
glCheckFramebufferStatus(GL_FRAMEBUFFER));
GLsizei size = width_ * width_ * 4;
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
glReadPixels(0, 0, width_, width_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
EXPECT_EQ(static_cast<GLenum>(GL_INVALID_FRAMEBUFFER_OPERATION),
glGetError());
diff --git a/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc b/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc
index d3d51a6..df65efe 100644
--- a/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc
+++ b/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc
@@ -7,6 +7,8 @@
#include <GLES2/gl2extchromium.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "gpu/config/gpu_test_config.h"
@@ -154,7 +156,7 @@
// values. These might be due to different MSAA sample counts causing
// different samples to hit. Other option is driver bugs. Just test that
// disabling multisample causes a difference.
- scoped_ptr<uint8_t[]> results[3];
+ std::unique_ptr<uint8_t[]> results[3];
const GLint kResultSize = kWidth * kHeight * 4;
for (int pass = 0; pass < 3; pass++) {
PrepareForDraw();
@@ -206,7 +208,7 @@
// even approximate sample values is not that easy. Thus, just test
// representative positions which have fractional pixels, inspecting that
// normal rendering is different to SAMPLE_ALPHA_TO_ONE rendering.
- scoped_ptr<uint8_t[]> results[3];
+ std::unique_ptr<uint8_t[]> results[3];
const GLint kResultSize = kWidth * kHeight * 4;
for (int pass = 0; pass < 3; ++pass) {
diff --git a/gpu/command_buffer/tests/gl_fence_sync_unittest.cc b/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
index 50de9c1..5b37194e 100644
--- a/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
+++ b/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
@@ -6,7 +6,8 @@
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
#include "gpu/command_buffer/tests/gl_manager.h"
@@ -36,7 +37,7 @@
sync_point_manager_.reset();
}
- scoped_ptr<SyncPointManager> sync_point_manager_;
+ std::unique_ptr<SyncPointManager> sync_point_manager_;
GLManager gl1_;
GLManager gl2_;
};
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
index 5f1e1e0..38565cb6 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -8,6 +8,8 @@
#include <GLES2/gl2extchromium.h>
#include <stdint.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/process/process_handle.h"
@@ -172,7 +174,7 @@
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// Create the gpu memory buffer.
- scoped_ptr<gfx::GpuMemoryBuffer> buffer(gl_.CreateGpuMemoryBuffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> buffer(gl_.CreateGpuMemoryBuffer(
gfx::Size(kImageWidth, kImageHeight), GetParam()));
// Map buffer for writing.
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 3c9243d..006903c 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -15,6 +15,7 @@
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted_memory.h"
#include "build/build_config.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
@@ -215,18 +216,18 @@
}
}
-scoped_ptr<gfx::GpuMemoryBuffer> GLManager::CreateGpuMemoryBuffer(
+std::unique_ptr<gfx::GpuMemoryBuffer> GLManager::CreateGpuMemoryBuffer(
const gfx::Size& size,
gfx::BufferFormat format) {
#if defined(OS_MACOSX)
if (use_iosurface_memory_buffers_) {
- return make_scoped_ptr<gfx::GpuMemoryBuffer>(
+ return base::WrapUnique<gfx::GpuMemoryBuffer>(
new IOSurfaceGpuMemoryBuffer(size, format));
}
#endif // defined(OS_MACOSX)
std::vector<uint8_t> data(gfx::BufferSizeForBufferFormat(size, format), 0);
scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes(data));
- return make_scoped_ptr<gfx::GpuMemoryBuffer>(
+ return base::WrapUnique<gfx::GpuMemoryBuffer>(
new GpuMemoryBufferImpl(bytes.get(), size, format));
}
@@ -567,7 +568,7 @@
unsigned internalformat,
unsigned usage) {
DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM));
- scoped_ptr<gfx::GpuMemoryBuffer> buffer = CreateGpuMemoryBuffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> buffer = CreateGpuMemoryBuffer(
gfx::Size(width, height), gfx::BufferFormat::RGBA_8888);
return CreateImage(buffer->AsClientBuffer(), width, height, internalformat);
}
diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h
index 4819e4c..993472ba 100644
--- a/gpu/command_buffer/tests/gl_manager.h
+++ b/gpu/command_buffer/tests/gl_manager.h
@@ -8,9 +8,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/feature_info.h"
@@ -78,7 +79,7 @@
GLManager();
~GLManager() override;
- scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
const gfx::Size& size,
gfx::BufferFormat format);
@@ -162,17 +163,17 @@
SyncPointManager* sync_point_manager_; // Non-owning.
scoped_refptr<SyncPointOrderData> sync_point_order_data_;
- scoped_ptr<SyncPointClient> sync_point_client_;
+ std::unique_ptr<SyncPointClient> sync_point_client_;
scoped_refptr<gles2::MailboxManager> mailbox_manager_;
scoped_refptr<gfx::GLShareGroup> share_group_;
- scoped_ptr<CommandBufferService> command_buffer_;
- scoped_ptr<gles2::GLES2Decoder> decoder_;
- scoped_ptr<CommandExecutor> executor_;
+ std::unique_ptr<CommandBufferService> command_buffer_;
+ std::unique_ptr<gles2::GLES2Decoder> decoder_;
+ std::unique_ptr<CommandExecutor> executor_;
scoped_refptr<gfx::GLSurface> surface_;
scoped_refptr<gfx::GLContext> context_;
- scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_;
- scoped_ptr<TransferBuffer> transfer_buffer_;
- scoped_ptr<gles2::GLES2Implementation> gles2_implementation_;
+ std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_;
+ std::unique_ptr<TransferBuffer> transfer_buffer_;
+ std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_;
bool context_lost_allowed_;
bool pause_commands_;
uint32_t paused_order_num_;
diff --git a/gpu/command_buffer/tests/gl_readback_unittest.cc b/gpu/command_buffer/tests/gl_readback_unittest.cc
index eaaa1bb59..c9038dc 100644
--- a/gpu/command_buffer/tests/gl_readback_unittest.cc
+++ b/gpu/command_buffer/tests/gl_readback_unittest.cc
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <cmath>
+#include <memory>
#include "base/bind.h"
#include "base/bit_cast.h"
@@ -274,7 +275,7 @@
switch (read_type) {
case GL_HALF_FLOAT_OES: {
- scoped_ptr<GLushort[]> buf(
+ std::unique_ptr<GLushort[]> buf(
new GLushort[kTextureSize * kTextureSize * read_comp_count]);
glReadPixels(
0, 0, kTextureSize, kTextureSize, read_format, read_type,
@@ -291,7 +292,7 @@
break;
}
case GL_FLOAT: {
- scoped_ptr<GLfloat[]> buf(
+ std::unique_ptr<GLfloat[]> buf(
new GLfloat[kTextureSize * kTextureSize * read_comp_count]);
glReadPixels(
0, 0, kTextureSize, kTextureSize, read_format, read_type,
diff --git a/gpu/command_buffer/tests/gl_test_utils.cc b/gpu/command_buffer/tests/gl_test_utils.cc
index d9a30ce9..b68320f 100644
--- a/gpu/command_buffer/tests/gl_test_utils.cc
+++ b/gpu/command_buffer/tests/gl_test_utils.cc
@@ -8,9 +8,9 @@
#include <stdint.h>
#include <stdio.h>
+#include <memory>
#include <string>
-#include "base/memory/scoped_ptr.h"
#include "base/strings/stringize_macros.h"
#include "base/strings/stringprintf.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -201,7 +201,7 @@
GLint tolerance,
const uint8_t* color) {
GLsizei size = width * height * 4;
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]);
memset(pixels.get(), kCheckClearValue, size);
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
int bad_count = 0;
@@ -273,7 +273,7 @@
glPixelStorei(GL_PACK_ALIGNMENT, 1);
int num_pixels = width * height;
int size = num_pixels * 4;
- scoped_ptr<uint8_t[]> data(new uint8_t[size]);
+ std::unique_ptr<uint8_t[]> data(new uint8_t[size]);
uint8_t* pixels = data.get();
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
diff --git a/gpu/command_buffer/tests/gl_unittest.cc b/gpu/command_buffer/tests/gl_unittest.cc
index fdfca09c..8a713fcc 100644
--- a/gpu/command_buffer/tests/gl_unittest.cc
+++ b/gpu/command_buffer/tests/gl_unittest.cc
@@ -6,6 +6,8 @@
#include <GLES2/gl2ext.h>
#include <stdint.h>
+#include <memory>
+
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
@@ -40,7 +42,7 @@
GLuint fbo = 0;
glGenFramebuffers(1, &fbo);
glBindTexture(GL_TEXTURE_2D, tex);
- scoped_ptr<uint8_t[]> pixels(new uint8_t[16 * 16 * 4]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[16 * 16 * 4]);
memset(pixels.get(), 0, 16*16*4);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
pixels.get());
diff --git a/gpu/config/gpu_blacklist_unittest.cc b/gpu/config/gpu_blacklist_unittest.cc
index 1c7211e..b5e27e7 100644
--- a/gpu/config/gpu_blacklist_unittest.cc
+++ b/gpu/config/gpu_blacklist_unittest.cc
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/memory/scoped_ptr.h"
#include "gpu/config/gpu_blacklist.h"
+
+#include <memory>
+
#include "gpu/config/gpu_control_list_jsons.h"
#include "gpu/config/gpu_feature_type.h"
#include "gpu/config/gpu_info.h"
@@ -46,7 +48,7 @@
" ]\n"
"}";
- scoped_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create());
+ std::unique_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create());
EXPECT_TRUE(blacklist->LoadList(json, GpuBlacklist::kAllOs));
std::set<int> type = blacklist->MakeDecision(
GpuBlacklist::kOsMacosx, kOsVersion, gpu_info());
@@ -74,7 +76,7 @@
};
TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) {
- scoped_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create());
+ std::unique_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create());
EXPECT_TRUE(blacklist->LoadList(
kSoftwareRenderingListJson, GpuBlacklist::kAllOs));
}
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index 09f6d1e6..9ff8a4d2 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -1363,7 +1363,7 @@
bool GpuControlList::LoadList(
const std::string& json_context,
GpuControlList::OsFilter os_filter) {
- scoped_ptr<base::Value> root = base::JSONReader::Read(json_context);
+ std::unique_ptr<base::Value> root = base::JSONReader::Read(json_context);
if (root.get() == NULL || !root->IsType(base::Value::TYPE_DICTIONARY))
return false;
diff --git a/gpu/config/gpu_control_list.h b/gpu/config/gpu_control_list.h
index 47282381..5d297761 100644
--- a/gpu/config/gpu_control_list.h
+++ b/gpu/config/gpu_control_list.h
@@ -8,13 +8,13 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <set>
#include <string>
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "build/build_config.h"
#include "gpu/gpu_export.h"
@@ -193,7 +193,7 @@
private:
OsType type_;
- scoped_ptr<VersionInfo> version_info_;
+ std::unique_ptr<VersionInfo> version_info_;
};
class GPU_EXPORT FloatInfo {
@@ -436,29 +436,29 @@
std::vector<int> cr_bugs_;
std::vector<int> webkit_bugs_;
std::vector<std::string> disabled_extensions_;
- scoped_ptr<OsInfo> os_info_;
+ std::unique_ptr<OsInfo> os_info_;
uint32_t vendor_id_;
std::vector<uint32_t> device_id_list_;
MultiGpuStyle multi_gpu_style_;
MultiGpuCategory multi_gpu_category_;
GLType gl_type_;
std::string driver_vendor_info_;
- scoped_ptr<VersionInfo> driver_version_info_;
- scoped_ptr<VersionInfo> driver_date_info_;
- scoped_ptr<VersionInfo> gl_version_info_;
+ std::unique_ptr<VersionInfo> driver_version_info_;
+ std::unique_ptr<VersionInfo> driver_date_info_;
+ std::unique_ptr<VersionInfo> gl_version_info_;
std::string gl_vendor_info_;
std::string gl_renderer_info_;
std::string gl_extensions_info_;
- scoped_ptr<IntInfo> gl_reset_notification_strategy_info_;
+ std::unique_ptr<IntInfo> gl_reset_notification_strategy_info_;
std::string cpu_brand_;
- scoped_ptr<FloatInfo> perf_graphics_info_;
- scoped_ptr<FloatInfo> perf_gaming_info_;
- scoped_ptr<FloatInfo> perf_overall_info_;
+ std::unique_ptr<FloatInfo> perf_graphics_info_;
+ std::unique_ptr<FloatInfo> perf_gaming_info_;
+ std::unique_ptr<FloatInfo> perf_overall_info_;
std::vector<std::string> machine_model_name_list_;
- scoped_ptr<VersionInfo> machine_model_version_info_;
- scoped_ptr<IntInfo> gpu_count_info_;
- scoped_ptr<BoolInfo> direct_rendering_info_;
- scoped_ptr<BoolInfo> in_process_gpu_info_;
+ std::unique_ptr<VersionInfo> machine_model_version_info_;
+ std::unique_ptr<IntInfo> gpu_count_info_;
+ std::unique_ptr<BoolInfo> direct_rendering_info_;
+ std::unique_ptr<BoolInfo> in_process_gpu_info_;
std::set<int> features_;
std::vector<ScopedGpuControlListEntry> exceptions_;
};
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc
index 91504c1..f26e3ac 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -4,6 +4,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/json/json_reader.h"
#include "gpu/config/gpu_control_list.h"
#include "gpu/config/gpu_info.h"
@@ -32,7 +34,7 @@
static ScopedEntry GetEntryFromString(
const std::string& json, bool supports_feature_type_all) {
- scoped_ptr<base::Value> root = base::JSONReader::Read(json);
+ std::unique_ptr<base::Value> root = base::JSONReader::Read(json);
base::DictionaryValue* value = NULL;
if (!root || !root->GetAsDictionary(&value))
return NULL;
diff --git a/gpu/config/gpu_control_list_unittest.cc b/gpu/config/gpu_control_list_unittest.cc
index ee8597b3..f3a3c09 100644
--- a/gpu/config/gpu_control_list_unittest.cc
+++ b/gpu/config/gpu_control_list_unittest.cc
@@ -4,9 +4,9 @@
#include <stdint.h>
+#include <memory>
#include <vector>
-#include "base/memory/scoped_ptr.h"
#include "gpu/config/gpu_control_list.h"
#include "gpu/config/gpu_info.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -68,7 +68,7 @@
};
TEST_F(GpuControlListTest, DefaultControlListSettings) {
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
// Default control list settings: all feature are allowed.
std::set<int> features = control_list->MakeDecision(
GpuControlList::kOsMacosx, kOsVersion, gpu_info());
@@ -85,7 +85,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(empty_list_json,
GpuControlList::kAllOs));
@@ -124,7 +124,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs));
std::set<int> features = control_list->MakeDecision(
@@ -162,7 +162,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
// ControlList entries won't be filtered to the current OS only upon loading.
EXPECT_TRUE(control_list->LoadList(vendor_json, GpuControlList::kAllOs));
@@ -214,7 +214,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_FALSE(control_list->LoadList(
unknown_field_json, GpuControlList::kAllOs));
@@ -253,7 +253,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_FALSE(control_list->LoadList(
unknown_exception_field_json, GpuControlList::kAllOs));
@@ -275,7 +275,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(disabled_json, GpuControlList::kAllOs));
std::set<int> features = control_list->MakeDecision(
GpuControlList::kOsWin, kOsVersion, gpu_info());
@@ -313,7 +313,7 @@
GPUInfo gpu_info;
gpu_info.gpu.vendor_id = kNvidiaVendorId;
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
std::set<int> features = control_list->MakeDecision(
@@ -360,7 +360,7 @@
GPUInfo gpu_info;
gpu_info.gpu.vendor_id = kIntelVendorId;
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
// The case this entry does not apply.
@@ -430,7 +430,7 @@
GPUInfo gpu_info;
gpu_info.gpu.vendor_id = kIntelVendorId;
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
std::set<int> features = control_list->MakeDecision(
GpuControlList::kOsLinux, kOsVersion, gpu_info);
@@ -478,7 +478,7 @@
gpu_info.gpu.device_id = 0x2a02;
gpu_info.driver_version = "9.1";
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
std::set<int> features = control_list->MakeDecision(
@@ -521,7 +521,7 @@
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
// Integrated GPU is active
@@ -559,7 +559,7 @@
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
// Discrete GPU is active
@@ -614,7 +614,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs));
GPUInfo gpu_info;
@@ -648,7 +648,7 @@
]
}
);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs));
GPUInfo gpu_info;
@@ -688,7 +688,7 @@
// Real case on Intel GMA* on Windows
gpu_info.secondary_gpus.push_back(gpu_info.gpu);
- scoped_ptr<GpuControlList> control_list(Create());
+ std::unique_ptr<GpuControlList> control_list(Create());
EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs));
std::set<int> features = control_list->MakeDecision(
GpuControlList::kOsWin, kOsVersion, gpu_info);
diff --git a/gpu/config/gpu_driver_bug_list_unittest.cc b/gpu/config/gpu_driver_bug_list_unittest.cc
index e7eaaa5..09612d2 100644
--- a/gpu/config/gpu_driver_bug_list_unittest.cc
+++ b/gpu/config/gpu_driver_bug_list_unittest.cc
@@ -4,9 +4,10 @@
#include <stdint.h>
+#include <memory>
+
#include "base/command_line.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/config/gpu_control_list_jsons.h"
#include "gpu/config/gpu_driver_bug_list.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
@@ -47,13 +48,13 @@
};
TEST_F(GpuDriverBugListTest, CurrentDriverBugListValidation) {
- scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
std::string json;
EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs));
}
TEST_F(GpuDriverBugListTest, CurrentListForARM) {
- scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs));
GPUInfo gpu_info;
@@ -65,7 +66,7 @@
}
TEST_F(GpuDriverBugListTest, CurrentListForImagination) {
- scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs));
GPUInfo gpu_info;
@@ -103,7 +104,7 @@
]
}
);
- scoped_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create());
EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs));
std::set<int> switching = driver_bug_list->MakeDecision(
GpuControlList::kOsMacosx, "10.8", gpu_info());
@@ -179,7 +180,7 @@
}
);
- scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
EXPECT_TRUE(list->LoadList(json, GpuControlList::kAllOs));
GPUInfo gpu_info;
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 44df9f1..499d0fb 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -11,7 +11,6 @@
#include <vector>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
diff --git a/gpu/config/gpu_info_collector_linux.cc b/gpu/config/gpu_info_collector_linux.cc
index 7fce931..74bc169 100644
--- a/gpu/config/gpu_info_collector_linux.cc
+++ b/gpu/config/gpu_info_collector_linux.cc
@@ -12,7 +12,6 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
diff --git a/gpu/config/gpu_info_collector_mac.mm b/gpu/config/gpu_info_collector_mac.mm
index f6d81fd..0e7e010 100644
--- a/gpu/config/gpu_info_collector_mac.mm
+++ b/gpu/config/gpu_info_collector_mac.mm
@@ -10,7 +10,6 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_ioobject.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
diff --git a/gpu/config/gpu_info_collector_unittest.cc b/gpu/config/gpu_info_collector_unittest.cc
index 3e35d00d..3e698d4 100644
--- a/gpu/config/gpu_info_collector_unittest.cc
+++ b/gpu/config/gpu_info_collector_unittest.cc
@@ -5,7 +5,8 @@
#include <stddef.h>
#include <stdint.h>
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "base/strings/string_split.h"
#include "gpu/config/gpu_info.h"
#include "gpu/config/gpu_info_collector.h"
@@ -173,7 +174,7 @@
public:
// Use StrictMock to make 100% sure we know how GL will be called.
- scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
+ std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_;
GPUInfo test_values_;
const char* gl_shading_language_version_ = nullptr;
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index 34fac587..525d3087 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -4,6 +4,7 @@
#include "gpu/config/gpu_util.h"
+#include <memory>
#include <vector>
#include "base/command_line.h"
@@ -56,7 +57,7 @@
void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info,
base::CommandLine* command_line) {
- scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
list->LoadList(kGpuDriverBugListJson,
GpuControlList::kCurrentOsOnly);
std::set<int> workarounds = list->MakeDecision(
diff --git a/gpu/config/gpu_util_unittest.cc b/gpu/config/gpu_util_unittest.cc
index fb7fd2be..4a7701e 100644
--- a/gpu/config/gpu_util_unittest.cc
+++ b/gpu/config/gpu_util_unittest.cc
@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include "gpu/config/gpu_util.h"
-#include "base/memory/scoped_ptr.h"
+
+#include <memory>
+
#include "base/strings/string_split.h"
#include "gpu/config/gpu_control_list_jsons.h"
#include "gpu/config/gpu_driver_bug_list.h"
@@ -79,7 +81,7 @@
ApplyGpuDriverBugWorkarounds_DisabledExtensions) {
GPUInfo gpu_info;
CollectBasicGraphicsInfo(&gpu_info);
- scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
+ std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
list->LoadList(kGpuDriverBugListJson, GpuControlList::kCurrentOsOnly);
list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info);
std::vector<std::string> expected_disabled_extensions =
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc
index a52d656..f1ce3a23 100644
--- a/gpu/gles2_conform_support/egl/display.cc
+++ b/gpu/gles2_conform_support/egl/display.cc
@@ -162,7 +162,7 @@
transfer_buffer_manager_ = manager;
manager->Initialize();
}
- scoped_ptr<gpu::CommandBufferService> command_buffer(
+ std::unique_ptr<gpu::CommandBufferService> command_buffer(
new gpu::CommandBufferService(transfer_buffer_manager_.get()));
if (!command_buffer->Initialize())
return NULL;
@@ -233,13 +233,13 @@
command_buffer->SetGetBufferChangeCallback(base::Bind(
&gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get())));
- scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper(
+ std::unique_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper(
new gpu::gles2::GLES2CmdHelper(command_buffer.get()));
if (!cmd_helper->Initialize(kCommandBufferSize))
return NULL;
- scoped_ptr<gpu::TransferBuffer> transfer_buffer(new gpu::TransferBuffer(
- cmd_helper.get()));
+ std::unique_ptr<gpu::TransferBuffer> transfer_buffer(
+ new gpu::TransferBuffer(cmd_helper.get()));
command_buffer_.reset(command_buffer.release());
transfer_buffer_.reset(transfer_buffer.release());
diff --git a/gpu/gles2_conform_support/egl/display.h b/gpu/gles2_conform_support/egl/display.h
index 81889d9..7e724fc 100644
--- a/gpu/gles2_conform_support/egl/display.h
+++ b/gpu/gles2_conform_support/egl/display.h
@@ -9,8 +9,9 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
@@ -118,18 +119,18 @@
uint64_t next_fence_sync_release_;
scoped_refptr<gpu::TransferBufferManagerInterface> transfer_buffer_manager_;
- scoped_ptr<gpu::CommandBufferService> command_buffer_;
- scoped_ptr<gpu::CommandExecutor> executor_;
- scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
+ std::unique_ptr<gpu::CommandBufferService> command_buffer_;
+ std::unique_ptr<gpu::CommandExecutor> executor_;
+ std::unique_ptr<gpu::gles2::GLES2Decoder> decoder_;
scoped_refptr<gfx::GLContext> gl_context_;
scoped_refptr<gfx::GLSurface> gl_surface_;
- scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_cmd_helper_;
- scoped_ptr<gpu::TransferBuffer> transfer_buffer_;
+ std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_cmd_helper_;
+ std::unique_ptr<gpu::TransferBuffer> transfer_buffer_;
// TODO(alokp): Support more than one config, surface, and context.
- scoped_ptr<Config> config_;
- scoped_ptr<Surface> surface_;
- scoped_ptr<gpu::gles2::GLES2Implementation> context_;
+ std::unique_ptr<Config> config_;
+ std::unique_ptr<Surface> surface_;
+ std::unique_ptr<gpu::gles2::GLES2Implementation> context_;
DISALLOW_COPY_AND_ASSIGN(Display);
};
diff --git a/gpu/gles2_conform_support/egl/egl.cc b/gpu/gles2_conform_support/egl/egl.cc
index 5a81954b..0435067 100644
--- a/gpu/gles2_conform_support/egl/egl.cc
+++ b/gpu/gles2_conform_support/egl/egl.cc
@@ -5,6 +5,8 @@
#include <EGL/egl.h>
#include <stdint.h>
+#include <memory>
+
#include "base/command_line.h"
#include "base/environment.h"
#include "base/strings/string_split.h"
@@ -116,7 +118,7 @@
// being called multiple times.
if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) {
base::CommandLine::StringVector argv;
- scoped_ptr<base::Environment> env(base::Environment::Create());
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
std::string env_string;
env->GetVar("CHROME_COMMAND_BUFFER_GLES2_ARGS", &env_string);
#if defined(OS_WIN)
diff --git a/gpu/gles2_conform_support/native/main.cc b/gpu/gles2_conform_support/native/main.cc
index be1fa72..672b212 100644
--- a/gpu/gles2_conform_support/native/main.cc
+++ b/gpu/gles2_conform_support/native/main.cc
@@ -4,9 +4,10 @@
#include <stddef.h>
+#include <memory>
+
#include "base/at_exit.h"
#include "base/command_line.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
@@ -36,7 +37,7 @@
base::mac::ScopedNSAutoreleasePool pool;
#endif
- scoped_ptr<const char*[]> argsArray(new const char*[args.size()+1]);
+ std::unique_ptr<const char* []> argsArray(new const char*[args.size() + 1]);
argsArray[0] = argv[0];
#if defined(OS_WIN)
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc
index eaa2ff1..7587212 100644
--- a/gpu/ipc/client/command_buffer_proxy_impl.cc
+++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -69,7 +69,7 @@
}
bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) {
- scoped_ptr<base::AutoLock> lock;
+ std::unique_ptr<base::AutoLock> lock;
if (lock_)
lock.reset(new base::AutoLock(*lock_));
bool handled = true;
@@ -92,7 +92,7 @@
}
void CommandBufferProxyImpl::OnChannelError() {
- scoped_ptr<base::AutoLock> lock;
+ std::unique_ptr<base::AutoLock> lock;
if (lock_)
lock.reset(new base::AutoLock(*lock_));
@@ -135,7 +135,7 @@
}
void CommandBufferProxyImpl::AddDeletionObserver(DeletionObserver* observer) {
- scoped_ptr<base::AutoLock> lock;
+ std::unique_ptr<base::AutoLock> lock;
if (lock_)
lock.reset(new base::AutoLock(*lock_));
deletion_observers_.AddObserver(observer);
@@ -143,7 +143,7 @@
void CommandBufferProxyImpl::RemoveDeletionObserver(
DeletionObserver* observer) {
- scoped_ptr<base::AutoLock> lock;
+ std::unique_ptr<base::AutoLock> lock;
if (lock_)
lock.reset(new base::AutoLock(*lock_));
deletion_observers_.RemoveObserver(observer);
@@ -346,7 +346,7 @@
int32_t new_id = channel_->ReserveTransferBufferId();
- scoped_ptr<base::SharedMemory> shared_memory(
+ std::unique_ptr<base::SharedMemory> shared_memory(
channel_->factory()->AllocateSharedMemory(size));
if (!shared_memory) {
if (last_state_.error == gpu::error::kNoError)
@@ -475,7 +475,7 @@
unsigned internal_format,
unsigned usage) {
CheckLock();
- scoped_ptr<gfx::GpuMemoryBuffer> buffer(
+ std::unique_ptr<gfx::GpuMemoryBuffer> buffer(
channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer(
gfx::Size(width, height),
gpu::DefaultBufferFormatForImageFormat(internal_format),
@@ -719,7 +719,7 @@
}
void CommandBufferProxyImpl::InvalidGpuReplyOnClientThread() {
- scoped_ptr<base::AutoLock> lock;
+ std::unique_ptr<base::AutoLock> lock;
if (lock_)
lock.reset(new base::AutoLock(*lock_));
OnDestroyed(gpu::error::kInvalidGpuMessage, gpu::error::kLostContext);
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h
index 7a200de..769b095 100644
--- a/gpu/ipc/client/command_buffer_proxy_impl.h
+++ b/gpu/ipc/client/command_buffer_proxy_impl.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <queue>
#include <string>
@@ -207,7 +208,7 @@
State last_state_;
// The shared memory area used to update state.
- scoped_ptr<base::SharedMemory> shared_state_shm_;
+ std::unique_ptr<base::SharedMemory> shared_state_shm_;
// |*this| is owned by |*channel_| and so is always outlived by it, so using a
// raw pointer is ok.
diff --git a/gpu/ipc/client/gpu_channel_host.cc b/gpu/ipc/client/gpu_channel_host.cc
index 54ad6a93..68ed8cc 100644
--- a/gpu/ipc/client/gpu_channel_host.cc
+++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -10,6 +10,7 @@
#include "base/atomic_sequence_num.h"
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/posix/eintr_wrapper.h"
#include "base/profiler/scoped_tracker.h"
#include "base/single_thread_task_runner.h"
@@ -100,7 +101,7 @@
bool GpuChannelHost::Send(IPC::Message* msg) {
// Callee takes ownership of message, regardless of whether Send is
// successful. See IPC::Sender.
- scoped_ptr<IPC::Message> message(msg);
+ std::unique_ptr<IPC::Message> message(msg);
// The GPU process never sends synchronous IPCs so clear the unblock flag to
// preserve order.
message->set_unblock(false);
@@ -188,7 +189,7 @@
flush_info->flushed_stream_flush_id = flush_info->flush_id;
}
-scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer(
+std::unique_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer(
gpu::SurfaceHandle surface_handle,
const gfx::Size& size,
CommandBufferProxyImpl* share_group,
@@ -234,8 +235,8 @@
return nullptr;
}
- scoped_ptr<CommandBufferProxyImpl> command_buffer =
- make_scoped_ptr(new CommandBufferProxyImpl(this, route_id, stream_id));
+ std::unique_ptr<CommandBufferProxyImpl> command_buffer =
+ base::WrapUnique(new CommandBufferProxyImpl(this, route_id, stream_id));
AddRoute(route_id, command_buffer->AsWeakPtr());
return command_buffer;
diff --git a/gpu/ipc/client/gpu_channel_host.h b/gpu/ipc/client/gpu_channel_host.h
index f2c27e1..0ebe667 100644
--- a/gpu/ipc/client/gpu_channel_host.h
+++ b/gpu/ipc/client/gpu_channel_host.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
#include <vector>
@@ -15,7 +16,6 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "base/synchronization/lock.h"
@@ -57,7 +57,8 @@
virtual bool IsMainThread() = 0;
virtual scoped_refptr<base::SingleThreadTaskRunner>
GetIOThreadTaskRunner() = 0;
- virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0;
+ virtual std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
+ size_t size) = 0;
};
// Encapsulates an IPC channel between the client and one GPU process.
@@ -108,7 +109,7 @@
void FlushPendingStream(int32_t stream_id);
// Create and connect to a command buffer in the GPU process.
- scoped_ptr<CommandBufferProxyImpl> CreateCommandBuffer(
+ std::unique_ptr<CommandBufferProxyImpl> CreateCommandBuffer(
gpu::SurfaceHandle surface_handle,
const gfx::Size& size,
CommandBufferProxyImpl* share_group,
@@ -289,7 +290,7 @@
// Protects channel_ and stream_flush_info_.
mutable base::Lock context_lock_;
- scoped_ptr<IPC::SyncChannel> channel_;
+ std::unique_ptr<IPC::SyncChannel> channel_;
base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_;
DISALLOW_COPY_AND_ASSIGN(GpuChannelHost);
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl.cc b/gpu/ipc/client/gpu_memory_buffer_impl.cc
index a1867d67..e2ac46e 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl.cc
@@ -38,7 +38,7 @@
}
// static
-scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle(
+std::unique_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl.h b/gpu/ipc/client/gpu_memory_buffer_impl.h
index f8b8fc0..8439d0f4 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl.h
+++ b/gpu/ipc/client/gpu_memory_buffer_impl.h
@@ -5,9 +5,10 @@
#ifndef GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_
#define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_
+#include <memory>
+
#include "base/callback.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/gpu_export.h"
#include "ui/gfx/geometry/size.h"
@@ -26,7 +27,7 @@
// should match what was used to allocate the |handle|. |callback| is
// called when instance is deleted, which is not necessarily on the same
// thread as this function was called on and instance was created on.
- static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
+ static std::unique_ptr<GpuMemoryBufferImpl> CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc
index 7c2bb9f..b6d5c369 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc
@@ -5,6 +5,7 @@
#include "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/mac/io_surface.h"
@@ -43,7 +44,7 @@
GpuMemoryBufferImplIOSurface::~GpuMemoryBufferImplIOSurface() {}
// static
-scoped_ptr<GpuMemoryBufferImplIOSurface>
+std::unique_ptr<GpuMemoryBufferImplIOSurface>
GpuMemoryBufferImplIOSurface::CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
@@ -55,7 +56,7 @@
if (!io_surface)
return nullptr;
- return make_scoped_ptr(
+ return base::WrapUnique(
new GpuMemoryBufferImplIOSurface(handle.id, size, format, callback,
io_surface.release(), LockFlags(usage)));
}
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h
index 1102274eaf..3a5a343 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h
@@ -9,6 +9,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/mac/scoped_cftyperef.h"
#include "base/macros.h"
#include "gpu/gpu_export.h"
@@ -21,7 +23,7 @@
public:
~GpuMemoryBufferImplIOSurface() override;
- static scoped_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle(
+ static std::unique_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
index 7554f3e..f050ef3 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/memory/ptr_util.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/ozone/public/client_native_pixmap_factory.h"
@@ -28,7 +29,7 @@
const gfx::Size& size,
gfx::BufferFormat format,
const DestructionCallback& callback,
- scoped_ptr<ui::ClientNativePixmap> pixmap)
+ std::unique_ptr<ui::ClientNativePixmap> pixmap)
: GpuMemoryBufferImpl(id, size, format, callback),
pixmap_(std::move(pixmap)),
data_(nullptr) {}
@@ -36,18 +37,18 @@
GpuMemoryBufferImplOzoneNativePixmap::~GpuMemoryBufferImplOzoneNativePixmap() {}
// static
-scoped_ptr<GpuMemoryBufferImplOzoneNativePixmap>
+std::unique_ptr<GpuMemoryBufferImplOzoneNativePixmap>
GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
const DestructionCallback& callback) {
- scoped_ptr<ui::ClientNativePixmap> native_pixmap =
+ std::unique_ptr<ui::ClientNativePixmap> native_pixmap =
ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle(
handle.native_pixmap_handle, size, usage);
DCHECK(native_pixmap);
- return make_scoped_ptr(new GpuMemoryBufferImplOzoneNativePixmap(
+ return base::WrapUnique(new GpuMemoryBufferImplOzoneNativePixmap(
handle.id, size, format, callback, std::move(native_pixmap)));
}
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h
index 3ec59e9..44b53df 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h
@@ -7,6 +7,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/macros.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
@@ -23,7 +25,7 @@
public:
~GpuMemoryBufferImplOzoneNativePixmap() override;
- static scoped_ptr<GpuMemoryBufferImplOzoneNativePixmap> CreateFromHandle(
+ static std::unique_ptr<GpuMemoryBufferImplOzoneNativePixmap> CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
@@ -51,9 +53,9 @@
const gfx::Size& size,
gfx::BufferFormat format,
const DestructionCallback& callback,
- scoped_ptr<ui::ClientNativePixmap> native_pixmap);
+ std::unique_ptr<ui::ClientNativePixmap> native_pixmap);
- scoped_ptr<ui::ClientNativePixmap> pixmap_;
+ std::unique_ptr<ui::ClientNativePixmap> pixmap_;
void* data_;
DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativePixmap);
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
index ef817243..40345fb 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/numerics/safe_math.h"
#include "base/process/memory.h"
#include "ui/gfx/buffer_format_util.h"
@@ -25,7 +26,7 @@
const gfx::Size& size,
gfx::BufferFormat format,
const DestructionCallback& callback,
- scoped_ptr<base::SharedMemory> shared_memory,
+ std::unique_ptr<base::SharedMemory> shared_memory,
size_t offset,
int stride)
: GpuMemoryBufferImpl(id, size, format, callback),
@@ -38,7 +39,7 @@
GpuMemoryBufferImplSharedMemory::~GpuMemoryBufferImplSharedMemory() {}
// static
-scoped_ptr<GpuMemoryBufferImplSharedMemory>
+std::unique_ptr<GpuMemoryBufferImplSharedMemory>
GpuMemoryBufferImplSharedMemory::Create(gfx::GpuMemoryBufferId id,
const gfx::Size& size,
gfx::BufferFormat format,
@@ -47,11 +48,11 @@
if (!gfx::BufferSizeForBufferFormatChecked(size, format, &buffer_size))
return nullptr;
- scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
+ std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
if (!shared_memory->CreateAndMapAnonymous(buffer_size))
return nullptr;
- return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory(
+ return base::WrapUnique(new GpuMemoryBufferImplSharedMemory(
id, size, format, callback, std::move(shared_memory), 0,
gfx::RowSizeForBufferFormat(size.width(), format, 0)));
}
@@ -82,7 +83,7 @@
}
// static
-scoped_ptr<GpuMemoryBufferImplSharedMemory>
+std::unique_ptr<GpuMemoryBufferImplSharedMemory>
GpuMemoryBufferImplSharedMemory::CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
@@ -91,9 +92,9 @@
const DestructionCallback& callback) {
DCHECK(base::SharedMemory::IsHandleValid(handle.handle));
- return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory(
+ return base::WrapUnique(new GpuMemoryBufferImplSharedMemory(
handle.id, size, format, callback,
- make_scoped_ptr(new base::SharedMemory(handle.handle, false)),
+ base::WrapUnique(new base::SharedMemory(handle.handle, false)),
handle.offset, handle.stride));
}
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h
index 3271c1a6..0ad9e3f 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h
@@ -7,6 +7,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/macros.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
@@ -18,7 +20,7 @@
public:
~GpuMemoryBufferImplSharedMemory() override;
- static scoped_ptr<GpuMemoryBufferImplSharedMemory> Create(
+ static std::unique_ptr<GpuMemoryBufferImplSharedMemory> Create(
gfx::GpuMemoryBufferId id,
const gfx::Size& size,
gfx::BufferFormat format,
@@ -30,7 +32,7 @@
gfx::BufferFormat format,
base::ProcessHandle child_process);
- static scoped_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle(
+ static std::unique_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
@@ -56,15 +58,16 @@
gfx::GpuMemoryBufferHandle GetHandle() const override;
private:
- GpuMemoryBufferImplSharedMemory(gfx::GpuMemoryBufferId id,
- const gfx::Size& size,
- gfx::BufferFormat format,
- const DestructionCallback& callback,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t offset,
- int stride);
+ GpuMemoryBufferImplSharedMemory(
+ gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ const DestructionCallback& callback,
+ std::unique_ptr<base::SharedMemory> shared_memory,
+ size_t offset,
+ int stride);
- scoped_ptr<base::SharedMemory> shared_memory_;
+ std::unique_ptr<base::SharedMemory> shared_memory_;
size_t offset_;
int stride_;
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc
index 3f9d898..257b64e 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.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 <memory>
+
#include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl_test_template.h"
@@ -23,7 +25,7 @@
for (auto format : gfx::GetBufferFormatsForTesting()) {
bool destroyed = false;
- scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer(
+ std::unique_ptr<GpuMemoryBufferImplSharedMemory> buffer(
GpuMemoryBufferImplSharedMemory::Create(
kBufferId, buffer_size, format,
base::Bind(&BufferDestroyed, base::Unretained(&destroyed))));
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc
index 5ff527e..c91f28a 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc
@@ -5,6 +5,7 @@
#include "gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "gpu/ipc/common/android/surface_texture_manager.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
@@ -62,7 +63,7 @@
}
// static
-scoped_ptr<GpuMemoryBufferImplSurfaceTexture>
+std::unique_ptr<GpuMemoryBufferImplSurfaceTexture>
GpuMemoryBufferImplSurfaceTexture::CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
@@ -78,7 +79,7 @@
ANativeWindow_setBuffersGeometry(native_window, size.width(), size.height(),
WindowFormat(format));
- return make_scoped_ptr(new GpuMemoryBufferImplSurfaceTexture(
+ return base::WrapUnique(new GpuMemoryBufferImplSurfaceTexture(
handle.id, size, format, callback, native_window));
}
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h
index e93b614..3e4f862 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h
@@ -8,6 +8,8 @@
#include <android/native_window.h>
#include <stddef.h>
+#include <memory>
+
#include "base/macros.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
@@ -20,7 +22,7 @@
public:
~GpuMemoryBufferImplSurfaceTexture() override;
- static scoped_ptr<GpuMemoryBufferImplSurfaceTexture> CreateFromHandle(
+ static std::unique_ptr<GpuMemoryBufferImplSurfaceTexture> CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h b/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h
index fa9b1dbc..e093698 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h
@@ -11,6 +11,8 @@
#include <stddef.h>
#include <string.h>
+#include <memory>
+
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/buffer_format_util.h"
@@ -61,7 +63,7 @@
GpuMemoryBufferImpl::DestructionCallback destroy_callback =
TestFixture::AllocateGpuMemoryBuffer(kBufferSize, format, usage,
&handle, &destroyed);
- scoped_ptr<TypeParam> buffer(TypeParam::CreateFromHandle(
+ std::unique_ptr<TypeParam> buffer(TypeParam::CreateFromHandle(
handle, kBufferSize, format, usage, destroy_callback));
ASSERT_TRUE(buffer);
EXPECT_EQ(buffer->GetFormat(), format);
@@ -88,7 +90,7 @@
TestFixture::AllocateGpuMemoryBuffer(
kBufferSize, format, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
&handle, nullptr);
- scoped_ptr<TypeParam> buffer(TypeParam::CreateFromHandle(
+ std::unique_ptr<TypeParam> buffer(TypeParam::CreateFromHandle(
handle, kBufferSize, format, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
destroy_callback));
ASSERT_TRUE(buffer);
@@ -104,7 +106,7 @@
gfx::RowSizeForBufferFormat(kBufferSize.width(), format, plane);
EXPECT_GT(row_size_in_bytes, 0u);
- scoped_ptr<char[]> data(new char[row_size_in_bytes]);
+ std::unique_ptr<char[]> data(new char[row_size_in_bytes]);
memset(data.get(), 0x2a + plane, row_size_in_bytes);
size_t height = kBufferSize.height() /
@@ -139,7 +141,7 @@
kBufferSize, format,
gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT, &handle,
nullptr);
- scoped_ptr<TypeParam> buffer(TypeParam::CreateFromHandle(
+ std::unique_ptr<TypeParam> buffer(TypeParam::CreateFromHandle(
handle, kBufferSize, format,
gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT,
destroy_callback));
@@ -155,7 +157,7 @@
gfx::RowSizeForBufferFormat(kBufferSize.width(), format, plane);
EXPECT_GT(row_size_in_bytes, 0u);
- scoped_ptr<char[]> data(new char[row_size_in_bytes]);
+ std::unique_ptr<char[]> data(new char[row_size_in_bytes]);
memset(data.get(), 0x2a + plane, row_size_in_bytes);
size_t height = kBufferSize.height() /
@@ -179,7 +181,7 @@
const size_t row_size_in_bytes =
gfx::RowSizeForBufferFormat(kBufferSize.width(), format, plane);
- scoped_ptr<char[]> data(new char[row_size_in_bytes]);
+ std::unique_ptr<char[]> data(new char[row_size_in_bytes]);
memset(data.get(), 0x2a + plane, row_size_in_bytes);
size_t height = kBufferSize.height() /
diff --git a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h
index 3d36bf7..eed42d2 100644
--- a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h
+++ b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h
@@ -7,10 +7,11 @@
#include <IOSurface/IOSurface.h>
#include <QuartzCore/QuartzCore.h>
+
#include <deque>
+#include <memory>
#include "base/mac/scoped_cftyperef.h"
-#include "base/memory/scoped_ptr.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
@@ -25,7 +26,7 @@
base::ScopedCFTypeRef<IOSurfaceRef> RootLayerIOSurface();
void CommitCALayers(CALayer* superlayer,
- scoped_ptr<CALayerPartialDamageTree> old_tree,
+ std::unique_ptr<CALayerPartialDamageTree> old_tree,
float scale_factor,
const gfx::Rect& pixel_damage_rect);
@@ -41,14 +42,14 @@
const gfx::Rect& pixel_damage_rect);
void UpdateRootAndPartialDamagePlanes(
- scoped_ptr<CALayerPartialDamageTree> old_tree,
+ std::unique_ptr<CALayerPartialDamageTree> old_tree,
const gfx::Rect& pixel_damage_rect);
void UpdateCALayers(CALayer* superlayer, float scale_factor);
const bool allow_partial_swap_;
- scoped_ptr<OverlayPlane> root_plane_;
- std::deque<scoped_ptr<OverlayPlane>> partial_damage_planes_;
+ std::unique_ptr<OverlayPlane> root_plane_;
+ std::deque<std::unique_ptr<OverlayPlane>> partial_damage_planes_;
};
} // content
diff --git a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm
index 25cd39d..65427b2 100644
--- a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm
+++ b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm
@@ -125,7 +125,7 @@
// Find the last partial damage plane to re-use the CALayer from. Grow the
// new rect for this layer to include this damage, and all nearby partial
// damage layers.
- scoped_ptr<OverlayPlane> plane_for_swap;
+ std::unique_ptr<OverlayPlane> plane_for_swap;
{
auto plane_to_reuse_iter = old_tree->partial_damage_planes_.end();
gfx::Rect plane_to_reuse_enlarged_pixel_damage_rect;
@@ -207,7 +207,7 @@
}
void CALayerPartialDamageTree::UpdateRootAndPartialDamagePlanes(
- scoped_ptr<CALayerPartialDamageTree> old_tree,
+ std::unique_ptr<CALayerPartialDamageTree> old_tree,
const gfx::Rect& pixel_damage_rect) {
// First update the partial damage tree.
UpdatePartialDamagePlanes(old_tree.get(), pixel_damage_rect);
@@ -276,7 +276,7 @@
void CALayerPartialDamageTree::CommitCALayers(
CALayer* superlayer,
- scoped_ptr<CALayerPartialDamageTree> old_tree,
+ std::unique_ptr<CALayerPartialDamageTree> old_tree,
float scale_factor,
const gfx::Rect& pixel_damage_rect) {
TRACE_EVENT0("gpu", "CALayerPartialDamageTree::CommitCALayers");
diff --git a/gpu/ipc/service/ca_layer_tree_mac.h b/gpu/ipc/service/ca_layer_tree_mac.h
index 36aad0d..1e45fd1 100644
--- a/gpu/ipc/service/ca_layer_tree_mac.h
+++ b/gpu/ipc/service/ca_layer_tree_mac.h
@@ -7,12 +7,13 @@
#include <IOSurface/IOSurface.h>
#include <QuartzCore/QuartzCore.h>
+
#include <deque>
+#include <memory>
#include <vector>
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_nsobject.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/gpu_export.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
@@ -53,7 +54,7 @@
// be destroyed at the end of the function, and any CALayers in it which were
// not re-used by |this| will be removed from the CALayer hierarchy.
void CommitScheduledCALayers(CALayer* superlayer,
- scoped_ptr<CALayerTree> old_tree,
+ std::unique_ptr<CALayerTree> old_tree,
float scale_factor);
private:
diff --git a/gpu/ipc/service/ca_layer_tree_mac.mm b/gpu/ipc/service/ca_layer_tree_mac.mm
index ea0efd1..8acf01d 100644
--- a/gpu/ipc/service/ca_layer_tree_mac.mm
+++ b/gpu/ipc/service/ca_layer_tree_mac.mm
@@ -143,7 +143,7 @@
}
void CALayerTree::CommitScheduledCALayers(CALayer* superlayer,
- scoped_ptr<CALayerTree> old_tree,
+ std::unique_ptr<CALayerTree> old_tree,
float scale_factor) {
TRACE_EVENT0("gpu", "CALayerTree::CommitScheduledCALayers");
RootLayer* old_root_layer = nullptr;
diff --git a/gpu/ipc/service/ca_layer_tree_unittest_mac.mm b/gpu/ipc/service/ca_layer_tree_unittest_mac.mm
index 1805983..e9dca68 100644
--- a/gpu/ipc/service/ca_layer_tree_unittest_mac.mm
+++ b/gpu/ipc/service/ca_layer_tree_unittest_mac.mm
@@ -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 <memory>
+
#include "base/mac/sdk_forward_declarations.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/ipc/service/ca_layer_tree_mac.h"
@@ -38,7 +40,7 @@
float scale_factor = 1.0f;
bool result = false;
- scoped_ptr<CALayerTree> ca_layer_tree;
+ std::unique_ptr<CALayerTree> ca_layer_tree;
CALayer* root_layer = nil;
CALayer* clip_and_sorting_layer = nil;
CALayer* transform_layer = nil;
@@ -46,7 +48,7 @@
// Validate the initial values.
{
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -104,7 +106,7 @@
// Update just the clip rect and re-commit.
{
clip_rect = gfx::Rect(4, 8, 16, 32);
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -145,7 +147,7 @@
// Disable clipping and re-commit.
{
is_clipped = false;
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -183,7 +185,7 @@
// Change the transform and re-commit.
{
transform.Translate(5, 5);
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -219,7 +221,7 @@
// Change the edge antialiasing mask and commit.
{
edge_aa_mask = GL_CA_LAYER_EDGE_TOP_CHROMIUM;
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -253,7 +255,7 @@
// Change the contents and commit.
{
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -289,7 +291,7 @@
// Change the rect size.
{
rect = gfx::Rect(rect.origin(), gfx::Size(32, 16));
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -325,7 +327,7 @@
// Change the rect position.
{
rect = gfx::Rect(gfx::Point(16, 4), rect.size());
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -361,7 +363,7 @@
// Change the opacity.
{
opacity = 1.0f;
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -396,7 +398,7 @@
// Add the clipping and IOSurface contents back.
{
is_clipped = true;
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -432,7 +434,7 @@
// Change the scale factor. This should result in a new tree being created.
{
scale_factor = 2.0f;
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped,
clip_rect,
@@ -526,7 +528,7 @@
transforms[4].Translate(10, 10);
// Schedule and commit the layers.
- scoped_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
for (size_t i = 0; i < 5; ++i) {
bool result = ca_layer_tree->ScheduleCALayer(
is_clipped,
@@ -611,7 +613,7 @@
}
// Schedule and commit the layers.
- scoped_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
for (size_t i = 0; i < 3; ++i) {
bool result = ca_layer_tree->ScheduleCALayer(
is_clipped,
@@ -681,7 +683,7 @@
gfx::Rect(0, 0, 16, 16)
};
- scoped_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
// First send the various clip parameters to sorting context zero. This is
// legitimate.
for (size_t i = 0; i < 3; ++i) {
@@ -753,7 +755,7 @@
float scale_factor = 1.0f;
bool result = false;
- scoped_ptr<CALayerTree> ca_layer_tree;
+ std::unique_ptr<CALayerTree> ca_layer_tree;
CALayer* root_layer = nil;
CALayer* clip_and_sorting_layer = nil;
CALayer* transform_layer = nil;
@@ -763,7 +765,7 @@
// Validate the initial values.
{
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped, clip_rect, sorting_context_id, transform, io_surface,
contents_rect, rect, background_color, edge_aa_mask, opacity);
@@ -792,7 +794,7 @@
// Pass another frame.
{
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped, clip_rect, sorting_context_id, transform, io_surface,
contents_rect, rect, background_color, edge_aa_mask, opacity);
@@ -823,7 +825,7 @@
// Pass a frame that is clipped.
contents_rect = gfx::RectF(0, 0, 1, 0.9);
{
- scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
+ std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
result = new_ca_layer_tree->ScheduleCALayer(
is_clipped, clip_rect, sorting_context_id, transform, io_surface,
contents_rect, rect, background_color, edge_aa_mask, opacity);
diff --git a/gpu/ipc/service/child_window_surface_win.cc b/gpu/ipc/service/child_window_surface_win.cc
index 535451e..874b878e 100644
--- a/gpu/ipc/service/child_window_surface_win.cc
+++ b/gpu/ipc/service/child_window_surface_win.cc
@@ -4,6 +4,8 @@
#include "gpu/ipc/service/child_window_surface_win.h"
+#include <memory>
+
#include "base/compiler_specific.h"
#include "base/win/scoped_hdc.h"
#include "base/win/wrapped_window_proc.h"
@@ -160,7 +162,7 @@
alpha_ = has_alpha;
config_ = nullptr;
- scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current;
+ std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current;
gfx::GLContext* current_context = gfx::GLContext::GetCurrent();
bool was_current = current_context && current_context->IsCurrent(this);
if (was_current) {
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc
index a7f07ef..7a56a62 100644
--- a/gpu/ipc/service/gpu_channel.cc
+++ b/gpu/ipc/service/gpu_channel.cc
@@ -194,7 +194,7 @@
uint32_t order_num = sync_point_order_data_->GenerateUnprocessedOrderNumber(
sync_point_manager_);
- scoped_ptr<GpuChannelMessage> msg(
+ std::unique_ptr<GpuChannelMessage> msg(
new GpuChannelMessage(message, order_num, base::TimeTicks::Now()));
if (channel_messages_.empty()) {
@@ -958,7 +958,7 @@
return;
}
- scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
+ std::unique_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
this, sync_point_manager_, task_runner_.get(), share_group,
surface_handle, mailbox_manager_.get(), preempted_flag_.get(),
subscription_ref_set_.get(), pending_valuebuffer_state_.get(), size,
@@ -983,7 +983,7 @@
TRACE_EVENT1("gpu", "GpuChannel::OnDestroyCommandBuffer",
"route_id", route_id);
- scoped_ptr<GpuCommandBufferStub> stub = stubs_.take_and_erase(route_id);
+ std::unique_ptr<GpuCommandBufferStub> stub = stubs_.take_and_erase(route_id);
// In case the renderer is currently blocked waiting for a sync reply from the
// stub, we need to make sure to reschedule the correct stream here.
if (stub && !stub->IsScheduled()) {
diff --git a/gpu/ipc/service/gpu_channel.h b/gpu/ipc/service/gpu_channel.h
index 8090b40b8..cf4ff00 100644
--- a/gpu/ipc/service/gpu_channel.h
+++ b/gpu/ipc/service/gpu_channel.h
@@ -8,13 +8,13 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
#include "base/containers/hash_tables.h"
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "base/threading/thread_checker.h"
@@ -181,7 +181,7 @@
scoped_refptr<GpuChannelMessageFilter> filter_;
// Map of routing id to command buffer stub.
- base::ScopedPtrHashMap<int32_t, scoped_ptr<GpuCommandBufferStub>> stubs_;
+ base::ScopedPtrHashMap<int32_t, std::unique_ptr<GpuCommandBufferStub>> stubs_;
private:
bool OnControlMessageReceived(const IPC::Message& msg);
@@ -226,7 +226,7 @@
// message loop.
SyncPointManager* const sync_point_manager_;
- scoped_ptr<IPC::SyncChannel> channel_;
+ std::unique_ptr<IPC::SyncChannel> channel_;
IPC::Listener* unhandled_message_listener_;
@@ -453,7 +453,7 @@
bool enabled_;
bool scheduled_;
GpuChannel* const channel_;
- std::deque<scoped_ptr<GpuChannelMessage>> channel_messages_;
+ std::deque<std::unique_ptr<GpuChannelMessage>> channel_messages_;
mutable base::Lock channel_lock_;
// The following are accessed on the IO thread only.
@@ -464,7 +464,7 @@
// It is reset when we transition to IDLE.
base::TimeDelta max_preemption_time_;
// This timer is used and runs tasks on the IO thread.
- scoped_ptr<base::OneShotTimer> timer_;
+ std::unique_ptr<base::OneShotTimer> timer_;
base::ThreadChecker io_thread_checker_;
// Keeps track of sync point related state such as message order numbers.
diff --git a/gpu/ipc/service/gpu_channel_manager.cc b/gpu/ipc/service/gpu_channel_manager.cc
index 015ca333..a64dfca 100644
--- a/gpu/ipc/service/gpu_channel_manager.cc
+++ b/gpu/ipc/service/gpu_channel_manager.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "build/build_config.h"
@@ -144,13 +145,13 @@
return it != gpu_channels_.end() ? it->second : nullptr;
}
-scoped_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel(
+std::unique_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel(
int client_id,
uint64_t client_tracing_id,
bool preempts,
bool allow_view_command_buffers,
bool allow_real_time_streams) {
- return make_scoped_ptr(
+ return base::WrapUnique(
new GpuChannel(this, sync_point_manager(), watchdog_, share_group(),
mailbox_manager(), preempts ? preemption_flag() : nullptr,
preempts ? nullptr : preemption_flag(), task_runner_.get(),
@@ -164,7 +165,7 @@
bool preempts,
bool allow_view_command_buffers,
bool allow_real_time_streams) {
- scoped_ptr<GpuChannel> channel(
+ std::unique_ptr<GpuChannel> channel(
CreateGpuChannel(client_id, client_tracing_id, preempts,
allow_view_command_buffers, allow_real_time_streams));
IPC::ChannelHandle channel_handle = channel->Init(shutdown_event_);
diff --git a/gpu/ipc/service/gpu_channel_manager.h b/gpu/ipc/service/gpu_channel_manager.h
index fe3dd06..6ebd6ae 100644
--- a/gpu/ipc/service/gpu_channel_manager.h
+++ b/gpu/ipc/service/gpu_channel_manager.h
@@ -8,13 +8,13 @@
#include <stdint.h>
#include <deque>
+#include <memory>
#include <string>
#include <vector>
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/constants.h"
@@ -156,7 +156,7 @@
}
protected:
- virtual scoped_ptr<GpuChannel> CreateGpuChannel(
+ virtual std::unique_ptr<GpuChannel> CreateGpuChannel(
int client_id,
uint64_t client_tracing_id,
bool preempts,
@@ -181,7 +181,7 @@
// These objects manage channels to individual renderer processes there is
// one channel for each renderer process that has connected to this GPU
// process.
- base::ScopedPtrHashMap<int32_t, scoped_ptr<GpuChannel>> gpu_channels_;
+ base::ScopedPtrHashMap<int32_t, std::unique_ptr<GpuChannel>> gpu_channels_;
private:
void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
@@ -211,8 +211,8 @@
GpuMemoryManager gpu_memory_manager_;
// SyncPointManager guaranteed to outlive running MessageLoop.
SyncPointManager* sync_point_manager_;
- scoped_ptr<SyncPointClient> sync_point_client_waiter_;
- scoped_ptr<gles2::ProgramCache> program_cache_;
+ std::unique_ptr<SyncPointClient> sync_point_client_waiter_;
+ std::unique_ptr<gles2::ProgramCache> program_cache_;
scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache_;
scoped_refptr<gles2::FramebufferCompletenessCache>
framebuffer_completeness_cache_;
diff --git a/gpu/ipc/service/gpu_channel_test_common.cc b/gpu/ipc/service/gpu_channel_test_common.cc
index ae202124..dcc2a9f 100644
--- a/gpu/ipc/service/gpu_channel_test_common.cc
+++ b/gpu/ipc/service/gpu_channel_test_common.cc
@@ -4,6 +4,7 @@
#include "gpu/ipc/service/gpu_channel_test_common.h"
+#include "base/memory/ptr_util.h"
#include "base/test/test_simple_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
@@ -84,13 +85,13 @@
gpu_channels_.clear();
}
-scoped_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel(
+std::unique_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel(
int client_id,
uint64_t client_tracing_id,
bool preempts,
bool allow_view_command_buffers,
bool allow_real_time_streams) {
- return make_scoped_ptr(new TestGpuChannel(
+ return base::WrapUnique(new TestGpuChannel(
this, sync_point_manager(), share_group(), mailbox_manager(),
preempts ? preemption_flag() : nullptr,
preempts ? nullptr : preemption_flag(), task_runner_.get(),
diff --git a/gpu/ipc/service/gpu_channel_test_common.h b/gpu/ipc/service/gpu_channel_test_common.h
index 70918b8..a92045e 100644
--- a/gpu/ipc/service/gpu_channel_test_common.h
+++ b/gpu/ipc/service/gpu_channel_test_common.h
@@ -4,7 +4,8 @@
#include <stdint.h>
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/command_buffer/service/gpu_preferences.h"
#include "gpu/ipc/service/gpu_channel.h"
#include "gpu/ipc/service/gpu_channel_manager.h"
@@ -75,7 +76,7 @@
~TestGpuChannelManager() override;
protected:
- scoped_ptr<GpuChannel> CreateGpuChannel(
+ std::unique_ptr<GpuChannel> CreateGpuChannel(
int client_id,
uint64_t client_tracing_id,
bool preempts,
@@ -127,9 +128,9 @@
GpuPreferences gpu_preferences_;
scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
scoped_refptr<base::TestSimpleTaskRunner> io_task_runner_;
- scoped_ptr<SyncPointManager> sync_point_manager_;
- scoped_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_;
- scoped_ptr<GpuChannelManager> channel_manager_;
+ std::unique_ptr<SyncPointManager> sync_point_manager_;
+ std::unique_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_;
+ std::unique_ptr<GpuChannelManager> channel_manager_;
};
} // namespace gpu
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
index c9443ee..2f134e2 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -11,6 +11,7 @@
#include "base/hash.h"
#include "base/json/json_writer.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/shared_memory.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
@@ -56,7 +57,7 @@
int32_t start;
int32_t end;
- scoped_ptr<IPC::Message> reply;
+ std::unique_ptr<IPC::Message> reply;
};
namespace {
@@ -93,7 +94,7 @@
private:
~GpuCommandBufferMemoryTracker() override {}
- scoped_ptr<GpuMemoryTrackingGroup> tracking_group_;
+ std::unique_ptr<GpuMemoryTrackingGroup> tracking_group_;
const uint64_t client_tracing_id_;
const int client_id_;
const uint64_t share_group_tracing_guid_;
@@ -130,7 +131,7 @@
class DevToolsChannelData : public base::trace_event::ConvertableToTraceFormat {
public:
- static scoped_ptr<base::trace_event::ConvertableToTraceFormat>
+ static std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
CreateForChannel(GpuChannel* channel);
~DevToolsChannelData() override {}
@@ -142,16 +143,16 @@
private:
explicit DevToolsChannelData(base::Value* value) : value_(value) {}
- scoped_ptr<base::Value> value_;
+ std::unique_ptr<base::Value> value_;
DISALLOW_COPY_AND_ASSIGN(DevToolsChannelData);
};
-scoped_ptr<base::trace_event::ConvertableToTraceFormat>
+std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
DevToolsChannelData::CreateForChannel(GpuChannel* channel) {
- scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> res(new base::DictionaryValue);
res->SetInteger("renderer_pid", channel->GetClientPID());
res->SetDouble("used_bytes", channel->GetMemoryUsage());
- return make_scoped_ptr(new DevToolsChannelData(res.release()));
+ return base::WrapUnique(new DevToolsChannelData(res.release()));
}
CommandBufferId GetCommandBufferID(int channel_id, int32_t route_id) {
@@ -529,7 +530,7 @@
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize");
DCHECK(!command_buffer_.get());
- scoped_ptr<base::SharedMemory> shared_state_shm(
+ std::unique_ptr<base::SharedMemory> shared_state_shm(
new base::SharedMemory(shared_state_handle, false));
command_buffer_.reset(new CommandBufferService(
@@ -749,7 +750,7 @@
if (wait_for_token_)
LOG(ERROR) << "Got WaitForToken command while currently waiting for token.";
wait_for_token_ =
- make_scoped_ptr(new WaitForCommandState(start, end, reply_message));
+ base::WrapUnique(new WaitForCommandState(start, end, reply_message));
CheckCompleteWaits();
}
@@ -765,7 +766,7 @@
<< "Got WaitForGetOffset command while currently waiting for offset.";
}
wait_for_get_offset_ =
- make_scoped_ptr(new WaitForCommandState(start, end, reply_message));
+ base::WrapUnique(new WaitForCommandState(start, end, reply_message));
CheckCompleteWaits();
}
@@ -838,7 +839,7 @@
// Take ownership of the memory and map it into this process.
// This validates the size.
- scoped_ptr<base::SharedMemory> shared_memory(
+ std::unique_ptr<base::SharedMemory> shared_memory(
new base::SharedMemory(transfer_buffer, false));
if (!shared_memory->Map(size)) {
DVLOG(0) << "Failed to map shared memory.";
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.h b/gpu/ipc/service/gpu_command_buffer_stub.h
index 3b4992b..f354d55 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.h
+++ b/gpu/ipc/service/gpu_command_buffer_stub.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <deque>
+#include <memory>
#include <string>
#include <vector>
@@ -250,10 +251,10 @@
const int32_t route_id_;
uint32_t last_flush_count_;
- scoped_ptr<CommandBufferService> command_buffer_;
- scoped_ptr<gles2::GLES2Decoder> decoder_;
- scoped_ptr<CommandExecutor> executor_;
- scoped_ptr<SyncPointClient> sync_point_client_;
+ std::unique_ptr<CommandBufferService> command_buffer_;
+ std::unique_ptr<gles2::GLES2Decoder> decoder_;
+ std::unique_ptr<CommandExecutor> executor_;
+ std::unique_ptr<SyncPointClient> sync_point_client_;
scoped_refptr<gfx::GLSurface> surface_;
gfx::GLSurface::Format surface_format_;
@@ -274,8 +275,8 @@
GURL active_url_;
size_t active_url_hash_;
- scoped_ptr<WaitForCommandState> wait_for_token_;
- scoped_ptr<WaitForCommandState> wait_for_get_offset_;
+ std::unique_ptr<WaitForCommandState> wait_for_token_;
+ std::unique_ptr<WaitForCommandState> wait_for_get_offset_;
DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
};
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory.cc b/gpu/ipc/service/gpu_memory_buffer_factory.cc
index 01c62be..bd8a79f 100644
--- a/gpu/ipc/service/gpu_memory_buffer_factory.cc
+++ b/gpu/ipc/service/gpu_memory_buffer_factory.cc
@@ -5,6 +5,7 @@
#include "gpu/ipc/service/gpu_memory_buffer_factory.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#if defined(OS_MACOSX)
@@ -22,15 +23,16 @@
namespace gpu {
// static
-scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::CreateNativeType() {
+std::unique_ptr<GpuMemoryBufferFactory>
+GpuMemoryBufferFactory::CreateNativeType() {
#if defined(OS_MACOSX)
- return make_scoped_ptr(new GpuMemoryBufferFactoryIOSurface);
+ return base::WrapUnique(new GpuMemoryBufferFactoryIOSurface);
#endif
#if defined(OS_ANDROID)
- return make_scoped_ptr(new GpuMemoryBufferFactorySurfaceTexture);
+ return base::WrapUnique(new GpuMemoryBufferFactorySurfaceTexture);
#endif
#if defined(USE_OZONE)
- return make_scoped_ptr(new GpuMemoryBufferFactoryOzoneNativePixmap);
+ return base::WrapUnique(new GpuMemoryBufferFactoryOzoneNativePixmap);
#endif
NOTREACHED();
return nullptr;
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory.h b/gpu/ipc/service/gpu_memory_buffer_factory.h
index beb278cb..0b2ba875e 100644
--- a/gpu/ipc/service/gpu_memory_buffer_factory.h
+++ b/gpu/ipc/service/gpu_memory_buffer_factory.h
@@ -5,11 +5,11 @@
#ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_
#define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_
+#include <memory>
#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/surface_handle.h"
#include "ui/gfx/geometry/size.h"
@@ -24,7 +24,7 @@
virtual ~GpuMemoryBufferFactory() {}
// Creates a new factory instance for native GPU memory buffers.
- static scoped_ptr<GpuMemoryBufferFactory> CreateNativeType();
+ static std::unique_ptr<GpuMemoryBufferFactory> CreateNativeType();
// Creates a new GPU memory buffer instance. A valid handle is returned on
// success. It can be called on any thread.
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
index a8c4600..775e74b0 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
@@ -6,6 +6,7 @@
#define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_
#include <list>
+#include <memory>
#include <vector>
#import "base/mac/scoped_nsobject.h"
@@ -99,12 +100,12 @@
// Planes that have been scheduled, but have not had a subsequent SwapBuffers
// call made yet.
- scoped_ptr<CALayerPartialDamageTree> pending_partial_damage_tree_;
- scoped_ptr<CALayerTree> pending_ca_layer_tree_;
+ std::unique_ptr<CALayerPartialDamageTree> pending_partial_damage_tree_;
+ std::unique_ptr<CALayerTree> pending_ca_layer_tree_;
// The planes that are currently being displayed on the screen.
- scoped_ptr<CALayerPartialDamageTree> current_partial_damage_tree_;
- scoped_ptr<CALayerTree> current_ca_layer_tree_;
+ std::unique_ptr<CALayerPartialDamageTree> current_partial_damage_tree_;
+ std::unique_ptr<CALayerTree> current_ca_layer_tree_;
// The vsync information provided by the browser.
bool vsync_parameters_valid_;
diff --git a/gpu/ipc/service/image_transport_surface_win.cc b/gpu/ipc/service/image_transport_surface_win.cc
index 818e7c81..7cc4454 100644
--- a/gpu/ipc/service/image_transport_surface_win.cc
+++ b/gpu/ipc/service/image_transport_surface_win.cc
@@ -4,6 +4,8 @@
#include "gpu/ipc/service/image_transport_surface.h"
+#include <memory>
+
#include "gpu/ipc/service/child_window_surface_win.h"
#include "gpu/ipc/service/pass_through_image_transport_surface.h"
#include "ui/gfx/native_widget_types.h"
@@ -30,7 +32,7 @@
surface = egl_surface;
// TODO(jbauman): Get frame statistics from DirectComposition
- scoped_ptr<gfx::VSyncProvider> vsync_provider(
+ std::unique_ptr<gfx::VSyncProvider> vsync_provider(
new gfx::VSyncProviderWin(surface_handle));
if (!egl_surface->Initialize(std::move(vsync_provider)))
return nullptr;
diff --git a/gpu/ipc/service/pass_through_image_transport_surface.cc b/gpu/ipc/service/pass_through_image_transport_surface.cc
index 2fdfb6c..4ff2739 100644
--- a/gpu/ipc/service/pass_through_image_transport_surface.cc
+++ b/gpu/ipc/service/pass_through_image_transport_surface.cc
@@ -40,7 +40,8 @@
}
gfx::SwapResult PassThroughImageTransportSurface::SwapBuffers() {
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers();
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info =
+ StartSwapBuffers();
gfx::SwapResult result = gfx::GLSurfaceAdapter::SwapBuffers();
FinishSwapBuffers(std::move(latency_info), result);
return result;
@@ -48,7 +49,8 @@
void PassThroughImageTransportSurface::SwapBuffersAsync(
const GLSurface::SwapCompletionCallback& callback) {
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers();
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info =
+ StartSwapBuffers();
// We use WeakPtr here to avoid manual management of life time of an instance
// of this class. Callback will not be called once the instance of this class
@@ -63,7 +65,8 @@
int y,
int width,
int height) {
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers();
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info =
+ StartSwapBuffers();
gfx::SwapResult result =
gfx::GLSurfaceAdapter::PostSubBuffer(x, y, width, height);
FinishSwapBuffers(std::move(latency_info), result);
@@ -76,7 +79,8 @@
int width,
int height,
const GLSurface::SwapCompletionCallback& callback) {
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers();
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info =
+ StartSwapBuffers();
gfx::GLSurfaceAdapter::PostSubBufferAsync(
x, y, width, height,
base::Bind(&PassThroughImageTransportSurface::FinishSwapBuffersAsync,
@@ -85,7 +89,8 @@
}
gfx::SwapResult PassThroughImageTransportSurface::CommitOverlayPlanes() {
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers();
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info =
+ StartSwapBuffers();
gfx::SwapResult result = gfx::GLSurfaceAdapter::CommitOverlayPlanes();
FinishSwapBuffers(std::move(latency_info), result);
return result;
@@ -93,7 +98,8 @@
void PassThroughImageTransportSurface::CommitOverlayPlanesAsync(
const GLSurface::SwapCompletionCallback& callback) {
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers();
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info =
+ StartSwapBuffers();
gfx::GLSurfaceAdapter::CommitOverlayPlanesAsync(base::Bind(
&PassThroughImageTransportSurface::FinishSwapBuffersAsync,
weak_ptr_factory_.GetWeakPtr(), base::Passed(&latency_info), callback));
@@ -132,7 +138,7 @@
}
}
-scoped_ptr<std::vector<ui::LatencyInfo>>
+std::unique_ptr<std::vector<ui::LatencyInfo>>
PassThroughImageTransportSurface::StartSwapBuffers() {
// GetVsyncValues before SwapBuffers to work around Mali driver bug:
// crbug.com/223558.
@@ -144,7 +150,7 @@
ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1);
}
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info(
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info(
new std::vector<ui::LatencyInfo>());
latency_info->swap(latency_info_);
@@ -152,7 +158,7 @@
}
void PassThroughImageTransportSurface::FinishSwapBuffers(
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info,
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info,
gfx::SwapResult result) {
base::TimeTicks swap_ack_time = base::TimeTicks::Now();
for (auto& latency : *latency_info) {
@@ -165,7 +171,7 @@
}
void PassThroughImageTransportSurface::FinishSwapBuffersAsync(
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info,
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info,
GLSurface::SwapCompletionCallback callback,
gfx::SwapResult result) {
FinishSwapBuffers(std::move(latency_info), result);
diff --git a/gpu/ipc/service/pass_through_image_transport_surface.h b/gpu/ipc/service/pass_through_image_transport_surface.h
index 4c8f927..e679fd5b 100644
--- a/gpu/ipc/service/pass_through_image_transport_surface.h
+++ b/gpu/ipc/service/pass_through_image_transport_surface.h
@@ -7,10 +7,10 @@
#include <stdint.h>
+#include <memory>
#include <vector>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "gpu/ipc/service/image_transport_surface.h"
#include "ui/gl/gl_surface.h"
@@ -52,11 +52,12 @@
void SendVSyncUpdateIfAvailable();
void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
- scoped_ptr<std::vector<ui::LatencyInfo>> StartSwapBuffers();
- void FinishSwapBuffers(scoped_ptr<std::vector<ui::LatencyInfo>> latency_info,
- gfx::SwapResult result);
+ std::unique_ptr<std::vector<ui::LatencyInfo>> StartSwapBuffers();
+ void FinishSwapBuffers(
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info,
+ gfx::SwapResult result);
void FinishSwapBuffersAsync(
- scoped_ptr<std::vector<ui::LatencyInfo>> latency_info,
+ std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info,
GLSurface::SwapCompletionCallback callback,
gfx::SwapResult result);
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
index fd4be17..49ad894 100644
--- a/gpu/ipc/service/stream_texture_android.cc
+++ b/gpu/ipc/service/stream_texture_android.cc
@@ -100,7 +100,8 @@
owner_stub_->channel()->RemoveRoute(route_id_);
if (framebuffer_) {
- scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current(MakeStubCurrent());
+ std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current(
+ MakeStubCurrent());
glDeleteProgram(program_);
glDeleteShader(vertex_shader_);
@@ -126,8 +127,8 @@
NOTREACHED();
}
-scoped_ptr<ui::ScopedMakeCurrent> StreamTexture::MakeStubCurrent() {
- scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current;
+std::unique_ptr<ui::ScopedMakeCurrent> StreamTexture::MakeStubCurrent() {
+ std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current;
bool needs_make_current =
!owner_stub_->decoder()->GetGLContext()->IsCurrent(NULL);
if (needs_make_current) {
@@ -143,7 +144,7 @@
if (!has_pending_frame_) return;
- scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current(MakeStubCurrent());
+ std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current(MakeStubCurrent());
surface_texture_->UpdateTexImage();
diff --git a/gpu/ipc/service/stream_texture_android.h b/gpu/ipc/service/stream_texture_android.h
index 5cf9d14..9f17ba7 100644
--- a/gpu/ipc/service/stream_texture_android.h
+++ b/gpu/ipc/service/stream_texture_android.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "gpu/command_buffer/service/gl_stream_texture_image.h"
@@ -64,7 +66,7 @@
// GpuCommandBufferStub::DestructionObserver implementation.
void OnWillDestroyStub() override;
- scoped_ptr<ui::ScopedMakeCurrent> MakeStubCurrent();
+ std::unique_ptr<ui::ScopedMakeCurrent> MakeStubCurrent();
void UpdateTexImage();
diff --git a/gpu/perftests/measurements.h b/gpu/perftests/measurements.h
index e0d9de3..f92e7ad6 100644
--- a/gpu/perftests/measurements.h
+++ b/gpu/perftests/measurements.h
@@ -5,9 +5,9 @@
#ifndef GPU_PERFTESTS_MEASUREMENTS_H_
#define GPU_PERFTESTS_MEASUREMENTS_H_
+#include <memory>
#include <string>
-#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
namespace gfx {
@@ -49,7 +49,7 @@
private:
base::TimeTicks wall_time_start_;
base::ThreadTicks cpu_time_start_;
- scoped_ptr<gfx::GPUTimer> gpu_timer_;
+ std::unique_ptr<gfx::GPUTimer> gpu_timer_;
base::TimeDelta wall_time_;
base::TimeDelta cpu_time_;
diff --git a/gpu/perftests/texture_upload_perftest.cc b/gpu/perftests/texture_upload_perftest.cc
index c3f3dfb..3cbcd07 100644
--- a/gpu/perftests/texture_upload_perftest.cc
+++ b/gpu/perftests/texture_upload_perftest.cc
@@ -6,12 +6,12 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include <vector>
#include "base/containers/small_map.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
#include "gpu/perftests/measurements.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -84,7 +84,7 @@
GLint len = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
if (len > 1) {
- scoped_ptr<char[]> error_log(new char[len]);
+ std::unique_ptr<char[]> error_log(new char[len]);
glGetShaderInfoLog(shader, len, NULL, error_log.get());
LOG(ERROR) << "Error compiling shader: " << error_log.get();
}
diff --git a/gpu/tools/compositor_model_bench/compositor_model_bench.cc b/gpu/tools/compositor_model_bench/compositor_model_bench.cc
index 3d3d57f..9a60adb2 100644
--- a/gpu/tools/compositor_model_bench/compositor_model_bench.cc
+++ b/gpu/tools/compositor_model_bench/compositor_model_bench.cc
@@ -28,7 +28,6 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/location.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
diff --git a/gpu/tools/compositor_model_bench/forward_render_model.h b/gpu/tools/compositor_model_bench/forward_render_model.h
index ec34948f5..cceddd9 100644
--- a/gpu/tools/compositor_model_bench/forward_render_model.h
+++ b/gpu/tools/compositor_model_bench/forward_render_model.h
@@ -7,8 +7,9 @@
#ifndef GPU_TOOLS_COMPOSITOR_MODEL_BENCH_FORWARD_RENDER_MODEL_H_
#define GPU_TOOLS_COMPOSITOR_MODEL_BENCH_FORWARD_RENDER_MODEL_H_
+#include <memory>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/tools/compositor_model_bench/render_model_utils.h"
#include "gpu/tools/compositor_model_bench/render_models.h"
@@ -24,8 +25,8 @@
void Resize(int width, int height) override;
private:
- scoped_ptr<ForwardRenderNodeVisitor> visitor_;
- scoped_ptr<TextureGenerator> textures_;
+ std::unique_ptr<ForwardRenderNodeVisitor> visitor_;
+ std::unique_ptr<TextureGenerator> textures_;
DISALLOW_IMPLICIT_CONSTRUCTORS(ForwardRenderSimulator);
};
diff --git a/gpu/tools/compositor_model_bench/render_model_utils.h b/gpu/tools/compositor_model_bench/render_model_utils.h
index 9162768..4c59f90 100644
--- a/gpu/tools/compositor_model_bench/render_model_utils.h
+++ b/gpu/tools/compositor_model_bench/render_model_utils.h
@@ -10,11 +10,11 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <set>
#include <vector>
#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/tools/compositor_model_bench/render_tree.h"
// This is a visitor that runs over the tree structure that was built from the
@@ -23,7 +23,7 @@
// texture ID's in the tree, replacing them with the matching new textures.
class TextureGenerator : public RenderNodeVisitor {
public:
- typedef scoped_ptr<uint8_t[]> ImagePtr;
+ typedef std::unique_ptr<uint8_t[]> ImagePtr;
typedef std::vector<Tile>::iterator tile_iter;
explicit TextureGenerator(RenderNode* root);
@@ -53,9 +53,9 @@
TextureGenStage stage_;
std::set<int> discovered_ids_;
- scoped_ptr<GLuint[]> tex_ids_;
+ std::unique_ptr<GLuint[]> tex_ids_;
std::map<int, int> remapped_ids_;
- scoped_ptr<ImagePtr[]> image_data_;
+ std::unique_ptr<ImagePtr[]> image_data_;
int images_generated_;
std::set<int> ids_for_completed_textures_;
};
diff --git a/gpu/tools/compositor_model_bench/render_models.h b/gpu/tools/compositor_model_bench/render_models.h
index 5d04a3f2..cc17dcb 100644
--- a/gpu/tools/compositor_model_bench/render_models.h
+++ b/gpu/tools/compositor_model_bench/render_models.h
@@ -8,10 +8,10 @@
#ifndef GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_MODELS_H_
#define GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_MODELS_H_
-#include "gpu/tools/compositor_model_bench/render_tree.h"
+#include <memory>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "gpu/tools/compositor_model_bench/render_tree.h"
enum RenderModel {
ForwardRenderModel
@@ -27,7 +27,7 @@
protected:
explicit RenderModelSimulator(RenderNode* root);
- scoped_ptr<RenderNode> root_;
+ std::unique_ptr<RenderNode> root_;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(RenderModelSimulator);
diff --git a/gpu/tools/compositor_model_bench/render_tree.cc b/gpu/tools/compositor_model_bench/render_tree.cc
index 143a1e30..7c495e27 100644
--- a/gpu/tools/compositor_model_bench/render_tree.cc
+++ b/gpu/tools/compositor_model_bench/render_tree.cc
@@ -4,6 +4,7 @@
#include "gpu/tools/compositor_model_bench/render_tree.h"
+#include <memory>
#include <sstream>
#include <vector>
@@ -12,9 +13,7 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/values.h"
-
#include "gpu/tools/compositor_model_bench/shaders.h"
using base::JSONReader;
@@ -459,7 +458,7 @@
int error_code = 0;
string error_message;
- scoped_ptr<base::Value> root = JSONReader::ReadAndReturnError(
+ std::unique_ptr<base::Value> root = JSONReader::ReadAndReturnError(
contents, base::JSON_ALLOW_TRAILING_COMMAS, &error_code, &error_message);
if (!root) {
LOG(ERROR) << "Failed to parse JSON file " << path.LossyDisplayName() <<
diff --git a/gpu/tools/compositor_model_bench/render_tree.h b/gpu/tools/compositor_model_bench/render_tree.h
index 5910474..01f50ac 100644
--- a/gpu/tools/compositor_model_bench/render_tree.h
+++ b/gpu/tools/compositor_model_bench/render_tree.h
@@ -10,11 +10,12 @@
#include <stddef.h>
+#include <memory>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "gpu/tools/compositor_model_bench/shaders.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
@@ -146,11 +147,11 @@
}
void add_child(RenderNode* child) {
- children_.push_back(make_scoped_ptr(child));
+ children_.push_back(base::WrapUnique(child));
}
private:
- std::vector<scoped_ptr<RenderNode>> children_;
+ std::vector<std::unique_ptr<RenderNode>> children_;
bool skipsDraw_;
};
diff --git a/gpu/tools/compositor_model_bench/shaders.cc b/gpu/tools/compositor_model_bench/shaders.cc
index 0ea6275e..864f1e2 100644
--- a/gpu/tools/compositor_model_bench/shaders.cc
+++ b/gpu/tools/compositor_model_bench/shaders.cc
@@ -7,6 +7,7 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include "gpu/tools/compositor_model_bench/render_model_utils.h"
#include "gpu/tools/compositor_model_bench/render_tree.h"
@@ -237,7 +238,7 @@
// Get the length of the log string
GLsizei length;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
- scoped_ptr<GLchar[]> log(new GLchar[length+1]);
+ std::unique_ptr<GLchar[]> log(new GLchar[length + 1]);
glGetShaderInfoLog(shader, length, NULL, log.get());
LOG(ERROR) << log.get() << " in shader " << ShaderNameFromID(id);
}
diff --git a/gpu/vulkan/tests/vulkan_test.cc b/gpu/vulkan/tests/vulkan_test.cc
index ec471a7..96c445a 100644
--- a/gpu/vulkan/tests/vulkan_test.cc
+++ b/gpu/vulkan/tests/vulkan_test.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 <memory>
+
#include "gpu/vulkan/tests/native_window.h"
#include "gpu/vulkan/vulkan_command_buffer.h"
#include "gpu/vulkan/vulkan_device_queue.h"
@@ -40,7 +42,7 @@
};
TEST_F(BasicVulkanTest, BasicVulkanSurface) {
- scoped_ptr<VulkanSurface> surface =
+ std::unique_ptr<VulkanSurface> surface =
VulkanSurface::CreateViewSurface(window());
EXPECT_TRUE(surface);
EXPECT_TRUE(surface->Initialize(GetDeviceQueue(),
@@ -49,7 +51,7 @@
}
TEST_F(BasicVulkanTest, EmptyVulkanSwaps) {
- scoped_ptr<VulkanSurface> surface =
+ std::unique_ptr<VulkanSurface> surface =
VulkanSurface::CreateViewSurface(window());
ASSERT_TRUE(surface);
ASSERT_TRUE(surface->Initialize(GetDeviceQueue(),
@@ -67,7 +69,7 @@
}
TEST_F(BasicVulkanTest, BasicRenderPass) {
- scoped_ptr<VulkanSurface> surface =
+ std::unique_ptr<VulkanSurface> surface =
VulkanSurface::CreateViewSurface(window());
ASSERT_TRUE(surface);
ASSERT_TRUE(surface->Initialize(GetDeviceQueue(),
diff --git a/gpu/vulkan/vulkan_command_buffer.h b/gpu/vulkan/vulkan_command_buffer.h
index 787488c1..b55b02c 100644
--- a/gpu/vulkan/vulkan_command_buffer.h
+++ b/gpu/vulkan/vulkan_command_buffer.h
@@ -9,7 +9,6 @@
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/vulkan/vulkan_export.h"
namespace gpu {
diff --git a/gpu/vulkan/vulkan_command_pool.cc b/gpu/vulkan/vulkan_command_pool.cc
index da78103..9f741f3c 100644
--- a/gpu/vulkan/vulkan_command_pool.cc
+++ b/gpu/vulkan/vulkan_command_pool.cc
@@ -46,9 +46,9 @@
}
}
-scoped_ptr<VulkanCommandBuffer>
+std::unique_ptr<VulkanCommandBuffer>
VulkanCommandPool::CreatePrimaryCommandBuffer() {
- scoped_ptr<VulkanCommandBuffer> command_buffer(
+ std::unique_ptr<VulkanCommandBuffer> command_buffer(
new VulkanCommandBuffer(device_queue_, this, true));
if (!command_buffer->Initialize())
return nullptr;
@@ -56,9 +56,9 @@
return command_buffer;
}
-scoped_ptr<VulkanCommandBuffer>
+std::unique_ptr<VulkanCommandBuffer>
VulkanCommandPool::CreateSecondaryCommandBuffer() {
- scoped_ptr<VulkanCommandBuffer> command_buffer(
+ std::unique_ptr<VulkanCommandBuffer> command_buffer(
new VulkanCommandBuffer(device_queue_, this, false));
if (!command_buffer->Initialize())
return nullptr;
diff --git a/gpu/vulkan/vulkan_command_pool.h b/gpu/vulkan/vulkan_command_pool.h
index 5b763ef..b54d5917 100644
--- a/gpu/vulkan/vulkan_command_pool.h
+++ b/gpu/vulkan/vulkan_command_pool.h
@@ -7,8 +7,9 @@
#include <vulkan/vulkan.h>
+#include <memory>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
namespace gpu {
@@ -23,8 +24,8 @@
bool Initialize();
void Destroy();
- scoped_ptr<VulkanCommandBuffer> CreatePrimaryCommandBuffer();
- scoped_ptr<VulkanCommandBuffer> CreateSecondaryCommandBuffer();
+ std::unique_ptr<VulkanCommandBuffer> CreatePrimaryCommandBuffer();
+ std::unique_ptr<VulkanCommandBuffer> CreateSecondaryCommandBuffer();
VkCommandPool handle() { return handle_; }
diff --git a/gpu/vulkan/vulkan_device_queue.cc b/gpu/vulkan/vulkan_device_queue.cc
index 17fc1a3..aa6f987 100644
--- a/gpu/vulkan/vulkan_device_queue.cc
+++ b/gpu/vulkan/vulkan_device_queue.cc
@@ -166,8 +166,8 @@
vk_physical_device_ = VK_NULL_HANDLE;
}
-scoped_ptr<VulkanCommandPool> VulkanDeviceQueue::CreateCommandPool() {
- scoped_ptr<VulkanCommandPool> command_pool(new VulkanCommandPool(this));
+std::unique_ptr<VulkanCommandPool> VulkanDeviceQueue::CreateCommandPool() {
+ std::unique_ptr<VulkanCommandPool> command_pool(new VulkanCommandPool(this));
if (!command_pool->Initialize())
return nullptr;
diff --git a/gpu/vulkan/vulkan_device_queue.h b/gpu/vulkan/vulkan_device_queue.h
index 59d3e96..ecb1724 100644
--- a/gpu/vulkan/vulkan_device_queue.h
+++ b/gpu/vulkan/vulkan_device_queue.h
@@ -7,9 +7,10 @@
#include <vulkan/vulkan.h>
+#include <memory>
+
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "gpu/vulkan/vulkan_export.h"
namespace gpu {
@@ -47,7 +48,7 @@
uint32_t GetVulkanQueueIndex() const { return vk_queue_index_; }
- scoped_ptr<gpu::VulkanCommandPool> CreateCommandPool();
+ std::unique_ptr<gpu::VulkanCommandPool> CreateCommandPool();
private:
VkPhysicalDevice vk_physical_device_ = VK_NULL_HANDLE;
diff --git a/gpu/vulkan/vulkan_implementation.h b/gpu/vulkan/vulkan_implementation.h
index fa8639d..83d0eb83 100644
--- a/gpu/vulkan/vulkan_implementation.h
+++ b/gpu/vulkan/vulkan_implementation.h
@@ -7,8 +7,6 @@
#include <vulkan/vulkan.h>
-#include "base/memory/scoped_ptr.h"
-
namespace gpu {
class VulkanCommandPool;
diff --git a/gpu/vulkan/vulkan_surface.cc b/gpu/vulkan/vulkan_surface.cc
index 8d1bbab9..c08b5e9 100644
--- a/gpu/vulkan/vulkan_surface.cc
+++ b/gpu/vulkan/vulkan_surface.cc
@@ -158,9 +158,9 @@
VulkanSurface::~VulkanSurface() {}
// static
-scoped_ptr<VulkanSurface> VulkanSurface::CreateViewSurface(
+std::unique_ptr<VulkanSurface> VulkanSurface::CreateViewSurface(
gfx::AcceleratedWidget window) {
- return scoped_ptr<VulkanSurface>(new VulkanWSISurface(window));
+ return std::unique_ptr<VulkanSurface>(new VulkanWSISurface(window));
}
VulkanSurface::VulkanSurface() {}
diff --git a/gpu/vulkan/vulkan_surface.h b/gpu/vulkan/vulkan_surface.h
index c1cd166..ab873c7 100644
--- a/gpu/vulkan/vulkan_surface.h
+++ b/gpu/vulkan/vulkan_surface.h
@@ -5,7 +5,8 @@
#ifndef GPU_VULKAN_VULKAN_SURFACE_H_
#define GPU_VULKAN_VULKAN_SURFACE_H_
-#include "base/memory/scoped_ptr.h"
+#include <memory>
+
#include "gpu/vulkan/vulkan_export.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
@@ -42,7 +43,7 @@
virtual void Finish() = 0;
// Create a surface that render directlys into a surface.
- static scoped_ptr<VulkanSurface> CreateViewSurface(
+ static std::unique_ptr<VulkanSurface> CreateViewSurface(
gfx::AcceleratedWidget window);
protected:
diff --git a/gpu/vulkan/vulkan_swap_chain.cc b/gpu/vulkan/vulkan_swap_chain.cc
index c4e62295..7d11e82b 100644
--- a/gpu/vulkan/vulkan_swap_chain.cc
+++ b/gpu/vulkan/vulkan_swap_chain.cc
@@ -41,7 +41,7 @@
VkDevice device = device_queue_->GetVulkanDevice();
VkQueue queue = device_queue_->GetVulkanQueue();
- scoped_ptr<ImageData>& current_image_data = images_[current_image_];
+ std::unique_ptr<ImageData>& current_image_data = images_[current_image_];
// Default image subresource range.
VkImageSubresourceRange image_subresource_range = {};
@@ -190,7 +190,7 @@
images_.resize(image_count);
for (uint32_t i = 0; i < image_count; ++i) {
images_[i].reset(new ImageData);
- scoped_ptr<ImageData>& image_data = images_[i];
+ std::unique_ptr<ImageData>& image_data = images_[i];
image_data->image = images[i];
// Setup semaphores.
@@ -258,7 +258,7 @@
next_present_semaphore_ = VK_NULL_HANDLE;
}
- for (const scoped_ptr<ImageData>& image_data : images_) {
+ for (const std::unique_ptr<ImageData>& image_data : images_) {
if (image_data->command_buffer) {
// Make sure command buffer is done processing.
image_data->command_buffer->Wait(UINT64_MAX);
diff --git a/gpu/vulkan/vulkan_swap_chain.h b/gpu/vulkan/vulkan_swap_chain.h
index e084716..08f3902 100644
--- a/gpu/vulkan/vulkan_swap_chain.h
+++ b/gpu/vulkan/vulkan_swap_chain.h
@@ -5,10 +5,10 @@
#ifndef GPU_VULKAN_VULKAN_SWAP_CHAIN_H_
#define GPU_VULKAN_VULKAN_SWAP_CHAIN_H_
+#include <memory>
#include <vector>
#include <vulkan/vulkan.h>
-#include "base/memory/scoped_ptr.h"
#include "gpu/vulkan/vulkan_export.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/swap_result.h"
@@ -64,7 +64,7 @@
VulkanDeviceQueue* device_queue_;
VkSwapchainKHR swap_chain_ = VK_NULL_HANDLE;
- scoped_ptr<VulkanCommandPool> command_pool_;
+ std::unique_ptr<VulkanCommandPool> command_pool_;
gfx::Size size_;
@@ -73,13 +73,13 @@
~ImageData();
VkImage image = VK_NULL_HANDLE;
- scoped_ptr<VulkanImageView> image_view;
- scoped_ptr<VulkanCommandBuffer> command_buffer;
+ std::unique_ptr<VulkanImageView> image_view;
+ std::unique_ptr<VulkanCommandBuffer> command_buffer;
VkSemaphore render_semaphore = VK_NULL_HANDLE;
VkSemaphore present_semaphore = VK_NULL_HANDLE;
};
- std::vector<scoped_ptr<ImageData>> images_;
+ std::vector<std::unique_ptr<ImageData>> images_;
uint32_t current_image_ = 0;
VkSemaphore next_present_semaphore_ = VK_NULL_HANDLE;
diff --git a/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h b/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h
index ec9a00c..ca16f17 100644
--- a/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h
+++ b/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -66,7 +68,7 @@
// GPU IO task runner.
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
- scoped_ptr<Receiver> receiver_;
+ std::unique_ptr<Receiver> receiver_;
DISALLOW_COPY_AND_ASSIGN(GpuJpegDecodeAcceleratorHost);
};