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

Unified Diff: ui/ozone/platform/wayland/wayland_surface_factory.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/wayland/wayland_surface_factory.cc
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.cc b/ui/ozone/platform/wayland/wayland_surface_factory.cc
index f254eb4c58afe7cf04e757e772d8037ea753e033..84c1bfe8aa5a444629edf2faee0c0b3c4c202665 100644
--- a/ui/ozone/platform/wayland/wayland_surface_factory.cc
+++ b/ui/ozone/platform/wayland/wayland_surface_factory.cc
@@ -8,6 +8,7 @@
#include <sys/mman.h>
#include <wayland-client.h>
+#include "base/memory/ptr_util.h"
#include "base/memory/shared_memory.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "ui/gfx/vsync_provider.h"
@@ -37,7 +38,7 @@ class WaylandCanvasSurface : public SurfaceOzoneCanvas {
skia::RefPtr<SkSurface> GetSurface() override;
void ResizeCanvas(const gfx::Size& viewport_size) override;
void PresentCanvas(const gfx::Rect& damage) override;
- scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
+ std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
private:
WaylandDisplay* display_;
@@ -62,7 +63,7 @@ skia::RefPtr<SkSurface> WaylandCanvasSurface::GetSurface() {
return sk_surface_;
size_t length = size_.width() * size_.height() * 4;
- auto shared_memory = make_scoped_ptr(new base::SharedMemory);
+ auto shared_memory = base::WrapUnique(new base::SharedMemory);
if (!shared_memory->CreateAndMapAnonymous(length))
return nullptr;
@@ -116,7 +117,8 @@ void WaylandCanvasSurface::PresentCanvas(const gfx::Rect& damage) {
display_->ScheduleFlush();
}
-scoped_ptr<gfx::VSyncProvider> WaylandCanvasSurface::CreateVSyncProvider() {
+std::unique_ptr<gfx::VSyncProvider>
+WaylandCanvasSurface::CreateVSyncProvider() {
// TODO(forney): This can be implemented with information from frame
// callbacks, and possibly output refresh rate.
NOTIMPLEMENTED();
@@ -145,19 +147,20 @@ bool WaylandSurfaceFactory::LoadEGLGLES2Bindings(
#endif
}
-scoped_ptr<SurfaceOzoneCanvas> WaylandSurfaceFactory::CreateCanvasForWidget(
- gfx::AcceleratedWidget widget) {
+std::unique_ptr<SurfaceOzoneCanvas>
+WaylandSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) {
WaylandWindow* window = display_->GetWindow(widget);
DCHECK(window);
- return make_scoped_ptr(new WaylandCanvasSurface(display_, window));
+ return base::WrapUnique(new WaylandCanvasSurface(display_, window));
}
-scoped_ptr<SurfaceOzoneEGL> WaylandSurfaceFactory::CreateEGLSurfaceForWidget(
+std::unique_ptr<SurfaceOzoneEGL>
+WaylandSurfaceFactory::CreateEGLSurfaceForWidget(
gfx::AcceleratedWidget widget) {
#if defined(USE_WAYLAND_EGL)
WaylandWindow* window = display_->GetWindow(widget);
DCHECK(window);
- auto surface = make_scoped_ptr(
+ auto surface = base::WrapUnique(
new WaylandEGLSurface(window, window->GetBounds().size()));
if (!surface->Initialize())
return nullptr;
« no previous file with comments | « ui/ozone/platform/wayland/wayland_surface_factory.h ('k') | ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698