diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 16:23:58 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 16:23:58 +0000 |
commit | 547710bf35dba8f15ab269e2da2199e992708f03 (patch) | |
tree | 10c023f2d2d0684e572f51b25c05016b66f1a097 /cc | |
parent | 85b863043edd48cbcb198675959d4c78da79592e (diff) | |
download | chromium_src-547710bf35dba8f15ab269e2da2199e992708f03.zip chromium_src-547710bf35dba8f15ab269e2da2199e992708f03.tar.gz chromium_src-547710bf35dba8f15ab269e2da2199e992708f03.tar.bz2 |
Rewrite scoped_ptr<T>(NULL) to use the default ctor in cc/.
This is the result of running the rewrite_scoped_ptr_ctor_null tool
across all files built on Linux in the cc/ directory.
BUG=173286
Review URL: https://chromiumcodereview.appspot.com/16355009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/base/scoped_ptr_hash_map.h | 8 | ||||
-rw-r--r-- | cc/base/scoped_ptr_vector.h | 2 | ||||
-rw-r--r-- | cc/layers/delegated_renderer_layer_impl_unittest.cc | 2 | ||||
-rw-r--r-- | cc/layers/layer_unittest.cc | 12 | ||||
-rw-r--r-- | cc/layers/nine_patch_layer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/layers/scrollbar_layer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/layers/texture_layer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/layers/tiled_layer_unittest.cc | 5 | ||||
-rw-r--r-- | cc/resources/prioritized_resource_unittest.cc | 2 | ||||
-rw-r--r-- | cc/resources/resource_update_controller_unittest.cc | 2 | ||||
-rw-r--r-- | cc/test/layer_tree_test.cc | 3 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_context.cc | 2 | ||||
-rw-r--r-- | cc/trees/single_thread_proxy.cc | 2 | ||||
-rw-r--r-- | cc/trees/tree_synchronizer_unittest.cc | 2 |
15 files changed, 23 insertions, 27 deletions
diff --git a/cc/base/scoped_ptr_hash_map.h b/cc/base/scoped_ptr_hash_map.h index 49421c3..4713582 100644 --- a/cc/base/scoped_ptr_hash_map.h +++ b/cc/base/scoped_ptr_hash_map.h @@ -73,7 +73,7 @@ class ScopedPtrHashMap { scoped_ptr<Value> take(iterator it) { DCHECK(it != data_.end()); if (it == data_.end()) - return scoped_ptr<Value>(NULL); + return scoped_ptr<Value>(); Key key = it->first; scoped_ptr<Value> ret(it->second); @@ -85,7 +85,7 @@ class ScopedPtrHashMap { scoped_ptr<Value> take(const Key& k) { iterator it = find(k); if (it == data_.end()) - return scoped_ptr<Value>(NULL); + return scoped_ptr<Value>(); return take(it); } @@ -93,7 +93,7 @@ class ScopedPtrHashMap { scoped_ptr<Value> take_and_erase(iterator it) { DCHECK(it != data_.end()); if (it == data_.end()) - return scoped_ptr<Value>(NULL); + return scoped_ptr<Value>(); scoped_ptr<Value> ret(it->second); data_.erase(it); @@ -103,7 +103,7 @@ class ScopedPtrHashMap { scoped_ptr<Value> take_and_erase(const Key& k) { iterator it = find(k); if (it == data_.end()) - return scoped_ptr<Value>(NULL); + return scoped_ptr<Value>(); return take_and_erase(it); } diff --git a/cc/base/scoped_ptr_vector.h b/cc/base/scoped_ptr_vector.h index 8cd368d..856e2f5 100644 --- a/cc/base/scoped_ptr_vector.h +++ b/cc/base/scoped_ptr_vector.h @@ -72,7 +72,7 @@ class ScopedPtrVector { scoped_ptr<T> take(iterator position) { if (position == end()) - return scoped_ptr<T>(NULL); + return scoped_ptr<T>(); DCHECK(position < end()); typename std::vector<T*>::iterator writable_position = position; diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc index c9501f0..6d8d383 100644 --- a/cc/layers/delegated_renderer_layer_impl_unittest.cc +++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc @@ -33,7 +33,7 @@ namespace { class DelegatedRendererLayerImplTest : public testing::Test { public: DelegatedRendererLayerImplTest() - : proxy_(scoped_ptr<Thread>(NULL)), + : proxy_(scoped_ptr<Thread>()), always_impl_thread_and_main_thread_blocked_(&proxy_) { LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index 8eb5861..0a3f607 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc @@ -41,7 +41,7 @@ class MockLayerTreeHost : public LayerTreeHost { public: explicit MockLayerTreeHost(LayerTreeHostClient* client) : LayerTreeHost(client, LayerTreeSettings()) { - Initialize(scoped_ptr<Thread>(NULL)); + Initialize(scoped_ptr<Thread>()); } MOCK_METHOD0(SetNeedsCommit, void()); @@ -734,15 +734,13 @@ class LayerTreeHostFactory { : client_(FakeLayerTreeHostClient::DIRECT_3D) {} scoped_ptr<LayerTreeHost> Create() { - return LayerTreeHost::Create(&client_, - LayerTreeSettings(), - scoped_ptr<Thread>(NULL)).Pass(); + return LayerTreeHost::Create( + &client_, LayerTreeSettings(), scoped_ptr<Thread>()).Pass(); } scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { - return LayerTreeHost::Create(&client_, - settings, - scoped_ptr<Thread>(NULL)).Pass(); + return LayerTreeHost::Create(&client_, settings, scoped_ptr<Thread>()) + .Pass(); } private: diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc index 089e058..1221f18 100644 --- a/cc/layers/nine_patch_layer_unittest.cc +++ b/cc/layers/nine_patch_layer_unittest.cc @@ -32,7 +32,7 @@ class MockLayerTreeHost : public LayerTreeHost { public: explicit MockLayerTreeHost(LayerTreeHostClient* client) : LayerTreeHost(client, LayerTreeSettings()) { - Initialize(scoped_ptr<Thread>(NULL)); + Initialize(scoped_ptr<Thread>()); } }; diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index f80e4ca..e7d2283 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -420,7 +420,7 @@ class MockLayerTreeHost : public LayerTreeHost { MockLayerTreeHost(LayerTreeHostClient* client, const LayerTreeSettings& settings) : LayerTreeHost(client, settings) { - Initialize(scoped_ptr<Thread>(NULL)); + Initialize(scoped_ptr<Thread>()); } }; diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc index 65351da..021265b 100644 --- a/cc/layers/texture_layer_unittest.cc +++ b/cc/layers/texture_layer_unittest.cc @@ -33,7 +33,7 @@ class MockLayerTreeHost : public LayerTreeHost { public: explicit MockLayerTreeHost(LayerTreeHostClient* client) : LayerTreeHost(client, LayerTreeSettings()) { - Initialize(scoped_ptr<Thread>(NULL)); + Initialize(scoped_ptr<Thread>()); } MOCK_METHOD0(AcquireLayerTextures, void()); diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc index 819a874..086b3af 100644 --- a/cc/layers/tiled_layer_unittest.cc +++ b/cc/layers/tiled_layer_unittest.cc @@ -56,9 +56,8 @@ class TiledLayerTest : public testing::Test { } virtual void SetUp() { - layer_tree_host_ = LayerTreeHost::Create(&fake_layer_impl_tree_host_client_, - settings_, - scoped_ptr<Thread>(NULL)); + layer_tree_host_ = LayerTreeHost::Create( + &fake_layer_impl_tree_host_client_, settings_, scoped_ptr<Thread>()); proxy_ = layer_tree_host_->proxy(); resource_manager_ = PrioritizedResourceManager::Create(proxy_); layer_tree_host_->InitializeOutputSurfaceIfNeeded(); diff --git a/cc/resources/prioritized_resource_unittest.cc b/cc/resources/prioritized_resource_unittest.cc index 96cbe42..09f55aa 100644 --- a/cc/resources/prioritized_resource_unittest.cc +++ b/cc/resources/prioritized_resource_unittest.cc @@ -17,7 +17,7 @@ namespace cc { class PrioritizedResourceTest : public testing::Test { public: PrioritizedResourceTest() - : proxy_(scoped_ptr<Thread>(NULL)), + : proxy_(scoped_ptr<Thread>()), texture_size_(256, 256), texture_format_(GL_RGBA), output_surface_(CreateFakeOutputSurface()) { diff --git a/cc/resources/resource_update_controller_unittest.cc b/cc/resources/resource_update_controller_unittest.cc index 5b55bcd..5507eb5 100644 --- a/cc/resources/resource_update_controller_unittest.cc +++ b/cc/resources/resource_update_controller_unittest.cc @@ -69,7 +69,7 @@ class WebGraphicsContext3DForUploadTest : public TestWebGraphicsContext3D { class ResourceUpdateControllerTest : public Test { public: ResourceUpdateControllerTest() - : proxy_(scoped_ptr<Thread>(NULL)), + : proxy_(scoped_ptr<Thread>()), queue_(make_scoped_ptr(new ResourceUpdateQueue)), resource_manager_(PrioritizedResourceManager::Create(&proxy_)), query_results_available_(0), diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 9f046d9e..b6f47ab 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -305,7 +305,6 @@ LayerTreeTest::LayerTreeTest() ended_(false), delegating_renderer_(false), timeout_seconds_(0), - impl_thread_(NULL), weak_factory_(this) { main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); @@ -386,7 +385,7 @@ void LayerTreeTest::PostSetVisibleToMainThread(bool visible) { void LayerTreeTest::DoBeginTest() { client_ = LayerTreeHostClientForTesting::Create(this); - scoped_ptr<cc::Thread> impl_ccthread(NULL); + scoped_ptr<cc::Thread> impl_ccthread; if (impl_thread_) { impl_ccthread = cc::ThreadImpl::CreateForDifferentThread( impl_thread_->message_loop_proxy()); diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 78e5a6d..360e4e3 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -61,7 +61,7 @@ class LayerTreeHostImplTest : public testing::Test, public LayerTreeHostImplClient { public: LayerTreeHostImplTest() - : proxy_(scoped_ptr<Thread>(NULL)), + : proxy_(scoped_ptr<Thread>()), always_impl_thread_(&proxy_), always_main_thread_blocked_(&proxy_), did_try_initialize_renderer_(false), diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index 95cc88e..f234996 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -1576,7 +1576,7 @@ class LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface bool delegating_renderer, bool impl_side_painting) { scoped_ptr<base::Thread> impl_thread; - scoped_ptr<cc::Thread> impl_ccthread(NULL); + scoped_ptr<cc::Thread> impl_ccthread; if (threaded) { impl_thread.reset(new base::Thread("LayerTreeTest")); impl_ccthread = cc::ThreadImpl::CreateForDifferentThread( diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 4bafe1c..a03f2b9 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -23,7 +23,7 @@ scoped_ptr<Proxy> SingleThreadProxy::Create(LayerTreeHost* layer_tree_host) { } SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host) - : Proxy(scoped_ptr<Thread>(NULL)), + : Proxy(scoped_ptr<Thread>()), layer_tree_host_(layer_tree_host), created_offscreen_context_provider_(false), next_frame_is_newly_committed_frame_(false), diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index 1d0dd75..68b2d24 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc @@ -483,7 +483,7 @@ TEST_F(TreeSynchronizerTest, SyncMaskReplicaAndReplicaMaskLayers) { TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { LayerTreeSettings settings; - FakeProxy proxy(scoped_ptr<Thread>(NULL)); + FakeProxy proxy((scoped_ptr<Thread>())); DebugScopedSetImplThread impl(&proxy); FakeRenderingStatsInstrumentation stats_instrumentation; scoped_ptr<LayerTreeHostImpl> host_impl = |