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

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

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/compositor/reflector_impl.h ('k') | content/browser/compositor/reflector_texture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/reflector_impl_unittest.cc
diff --git a/content/browser/compositor/reflector_impl_unittest.cc b/content/browser/compositor/reflector_impl_unittest.cc
index cebaf514ddaf1e958d52e2af8fa9c3922c984f57..e05af8b6d0f3651caf17dfb6bc16502f4f2c86a1 100644
--- a/content/browser/compositor/reflector_impl_unittest.cc
+++ b/content/browser/compositor/reflector_impl_unittest.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/browser/compositor/reflector_impl.h"
+
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
@@ -10,7 +13,6 @@
#include "cc/test/test_web_graphics_context_3d.h"
#include "content/browser/compositor/browser_compositor_output_surface.h"
#include "content/browser/compositor/browser_compositor_overlay_candidate_validator.h"
-#include "content/browser/compositor/reflector_impl.h"
#include "content/browser/compositor/reflector_texture.h"
#include "content/browser/compositor/test/no_transport_image_transport_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -57,12 +59,12 @@ class TestOverlayCandidatesOzone : public ui::OverlayCandidatesOzone {
};
#endif // defined(USE_OZONE)
-scoped_ptr<BrowserCompositorOverlayCandidateValidator>
+std::unique_ptr<BrowserCompositorOverlayCandidateValidator>
CreateTestValidatorOzone() {
#if defined(USE_OZONE)
- return scoped_ptr<BrowserCompositorOverlayCandidateValidator>(
+ return std::unique_ptr<BrowserCompositorOverlayCandidateValidator>(
new BrowserCompositorOverlayCandidateValidatorOzone(
- 0, scoped_ptr<ui::OverlayCandidatesOzone>(
+ 0, std::unique_ptr<ui::OverlayCandidatesOzone>(
new TestOverlayCandidatesOzone())));
#else
return nullptr;
@@ -109,7 +111,7 @@ class TestOutputSurface : public BrowserCompositorOutputSurface {
#endif
private:
- scoped_ptr<ReflectorTexture> reflector_texture_;
+ std::unique_ptr<ReflectorTexture> reflector_texture_;
};
const gfx::Rect kSubRect(0, 0, 64, 64);
@@ -123,7 +125,7 @@ class ReflectorImplTest : public testing::Test {
ui::ContextFactory* context_factory =
ui::InitializeContextFactoryForTests(enable_pixel_output);
ImageTransportFactory::InitializeForUnitTests(
- scoped_ptr<ImageTransportFactory>(
+ std::unique_ptr<ImageTransportFactory>(
new NoTransportImageTransportFactory));
message_loop_.reset(new base::MessageLoop());
task_runner_ = message_loop_->task_runner();
@@ -133,7 +135,7 @@ class ReflectorImplTest : public testing::Test {
compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
context_provider_ =
cc::TestContextProvider::Create(cc::TestWebGraphicsContext3D::Create());
- output_surface_ = scoped_ptr<TestOutputSurface>(
+ output_surface_ = std::unique_ptr<TestOutputSurface>(
new TestOutputSurface(context_provider_, compositor_->vsync_manager()));
CHECK(output_surface_->BindToClient(&output_surface_client_));
@@ -146,7 +148,7 @@ class ReflectorImplTest : public testing::Test {
}
void SetUpReflector() {
- reflector_ = make_scoped_ptr(
+ reflector_ = base::WrapUnique(
new ReflectorImpl(compositor_.get(), mirroring_layer_.get()));
reflector_->OnSourceSurfaceReady(output_surface_.get());
}
@@ -155,7 +157,7 @@ class ReflectorImplTest : public testing::Test {
if (reflector_)
reflector_->RemoveMirroringLayer(mirroring_layer_.get());
cc::TextureMailbox mailbox;
- scoped_ptr<cc::SingleReleaseCallback> release;
+ std::unique_ptr<cc::SingleReleaseCallback> release;
if (mirroring_layer_->PrepareTextureMailbox(&mailbox, &release, false)) {
release->Run(gpu::SyncToken(), false);
}
@@ -170,13 +172,13 @@ class ReflectorImplTest : public testing::Test {
scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
scoped_refptr<cc::ContextProvider> context_provider_;
cc::FakeOutputSurfaceClient output_surface_client_;
- scoped_ptr<base::MessageLoop> message_loop_;
+ std::unique_ptr<base::MessageLoop> message_loop_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- scoped_ptr<ui::Compositor> compositor_;
- scoped_ptr<ui::Layer> root_layer_;
- scoped_ptr<ui::Layer> mirroring_layer_;
- scoped_ptr<ReflectorImpl> reflector_;
- scoped_ptr<TestOutputSurface> output_surface_;
+ std::unique_ptr<ui::Compositor> compositor_;
+ std::unique_ptr<ui::Layer> root_layer_;
+ std::unique_ptr<ui::Layer> mirroring_layer_;
+ std::unique_ptr<ReflectorImpl> reflector_;
+ std::unique_ptr<TestOutputSurface> output_surface_;
};
namespace {
« no previous file with comments | « content/browser/compositor/reflector_impl.h ('k') | content/browser/compositor/reflector_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698