From 78d5331bcd375f8c8f0285d648dc30cc4f206367 Mon Sep 17 00:00:00 2001 From: dcheng Date: Sat, 27 Sep 2014 00:33:06 -0700 Subject: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (patchset #6 id:120001 of https://codereview.chromium.org/609663003/) Reason for revert: scoped_ptr nullptr support needs to be reverted Original issue's description: > cc: Remove use of PassAs() and constructor-casting with scoped_ptr. > > Say you have class A and subclass B. > > Previously it was required to PassAs() a scoped_ptr into a > scoped_ptr. This is no longer needed, so just use Pass(). For newly > created scoped_ptrs, you can just use make_scoped_ptr always now. > > And when you want to return or assign an empty scoped_ptr(), you can > now use nullptr directly. > > Also adds PRESUBMIT checks for: > - return scoped(foo). This should be return make_scoped_ptr(foo). > - bar = scoped(foo). This should be return bar = make_scoped_ptr(foo). > - return scoped(). This should be return nullptr. > - bar = scoped(). This should be return bar = nullptr. > > This also replaces p.reset() with p = nullptr; But it does not add a > PRESUBMIT check for that because there are things other than scoped_ptr > with a reset() function. > > R=enne@chromium.org > > Committed: https://crrev.com/7bb3dbede19d87f0338797756ffd738adc6bca08 > Cr-Commit-Position: refs/heads/master@{#297096} TBR=enne@chromium.org,jamesr@chromium.org,vmpstr@chromium.org,danakj@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/608503005 Cr-Commit-Position: refs/heads/master@{#297106} --- cc/trees/layer_tree_impl_unittest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cc/trees/layer_tree_impl_unittest.cc') diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 7fc1645..a0dd11a 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -25,7 +25,8 @@ class LayerTreeImplTest : public LayerTreeHostCommonTest { settings.layer_transforms_should_scale_layer_contents = true; host_impl_.reset( new FakeLayerTreeHostImpl(settings, &proxy_, &shared_bitmap_manager_)); - EXPECT_TRUE(host_impl_->InitializeRenderer(FakeOutputSurface::Create3d())); + EXPECT_TRUE(host_impl_->InitializeRenderer( + FakeOutputSurface::Create3d().PassAs())); } FakeLayerTreeHostImpl& host_impl() { return *host_impl_; } @@ -123,7 +124,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) { hud->SetDrawsContent(true); host_impl().active_tree()->set_hud_layer(hud.get()); - root->AddChild(hud.Pass()); + root->AddChild(hud.PassAs()); host_impl().SetViewportSize(hud_bounds); host_impl().active_tree()->SetRootLayer(root.Pass()); -- cgit v1.1