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

Unified Diff: ui/ozone/platform/cast/ozone_platform_cast.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
« no previous file with comments | « ui/ozone/platform/cast/overlay_manager_cast.cc ('k') | ui/ozone/platform/cast/surface_factory_cast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/cast/ozone_platform_cast.cc
diff --git a/ui/ozone/platform/cast/ozone_platform_cast.cc b/ui/ozone/platform/cast/ozone_platform_cast.cc
index 3600efb707295a88d91e4988d6eb4a71433c2547..3f5a1c3ded940e0b7c07083144e959d659574ea3 100644
--- a/ui/ozone/platform/cast/ozone_platform_cast.cc
+++ b/ui/ozone/platform/cast/ozone_platform_cast.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "chromecast/public/cast_egl_platform.h"
#include "chromecast/public/cast_egl_platform_shlib.h"
#include "ui/ozone/common/native_display_delegate_ozone.h"
@@ -27,7 +28,7 @@ using chromecast::CastEglPlatform;
namespace ui {
namespace {
-base::LazyInstance<scoped_ptr<GpuPlatformSupport>> g_gpu_platform_support =
+base::LazyInstance<std::unique_ptr<GpuPlatformSupport>> g_gpu_platform_support =
LAZY_INSTANCE_INITIALIZER;
// Ozone platform implementation for Cast. Implements functionality
@@ -39,7 +40,7 @@ base::LazyInstance<scoped_ptr<GpuPlatformSupport>> g_gpu_platform_support =
// to the CastEglPlatform interface.
class OzonePlatformCast : public OzonePlatform {
public:
- explicit OzonePlatformCast(scoped_ptr<CastEglPlatform> egl_platform)
+ explicit OzonePlatformCast(std::unique_ptr<CastEglPlatform> egl_platform)
: egl_platform_(std::move(egl_platform)) {}
~OzonePlatformCast() override {}
@@ -62,17 +63,18 @@ class OzonePlatformCast : public OzonePlatform {
GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return gpu_platform_support_host_.get();
}
- scoped_ptr<SystemInputInjector> CreateSystemInputInjector() override {
+ std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override {
return nullptr; // no input injection support
}
- scoped_ptr<PlatformWindow> CreatePlatformWindow(
+ std::unique_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) override {
- return make_scoped_ptr<PlatformWindow>(
+ return base::WrapUnique<PlatformWindow>(
new PlatformWindowCast(delegate, bounds));
}
- scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
- return make_scoped_ptr(new NativeDisplayDelegateOzone());
+ std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
+ override {
+ return base::WrapUnique(new NativeDisplayDelegateOzone());
}
void InitializeUI() override {
@@ -96,16 +98,16 @@ class OzonePlatformCast : public OzonePlatform {
void InitializeGPU() override {
surface_factory_.reset(new SurfaceFactoryCast(std::move(egl_platform_)));
g_gpu_platform_support.Get() =
- make_scoped_ptr(new GpuPlatformSupportCast(surface_factory_.get()));
+ base::WrapUnique(new GpuPlatformSupportCast(surface_factory_.get()));
}
private:
- scoped_ptr<CastEglPlatform> egl_platform_;
- scoped_ptr<SurfaceFactoryCast> surface_factory_;
- scoped_ptr<CursorFactoryOzone> cursor_factory_;
- scoped_ptr<InputController> input_controller_;
- scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
- scoped_ptr<OverlayManagerOzone> overlay_manager_;
+ std::unique_ptr<CastEglPlatform> egl_platform_;
+ std::unique_ptr<SurfaceFactoryCast> surface_factory_;
+ std::unique_ptr<CursorFactoryOzone> cursor_factory_;
+ std::unique_ptr<InputController> input_controller_;
+ std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
+ std::unique_ptr<OverlayManagerOzone> overlay_manager_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformCast);
};
@@ -115,7 +117,7 @@ class OzonePlatformCast : public OzonePlatform {
OzonePlatform* CreateOzonePlatformCast() {
const std::vector<std::string>& argv =
base::CommandLine::ForCurrentProcess()->argv();
- scoped_ptr<chromecast::CastEglPlatform> platform(
+ std::unique_ptr<chromecast::CastEglPlatform> platform(
chromecast::CastEglPlatformShlib::Create(argv));
return new OzonePlatformCast(std::move(platform));
}
« no previous file with comments | « ui/ozone/platform/cast/overlay_manager_cast.cc ('k') | ui/ozone/platform/cast/surface_factory_cast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698