Commit 2caaa922 authored by kylechar's avatar kylechar Committed by Commit Bot

Fix assigning NULL to scoped_refptr

Update code where NULL or 0 is assigned to a scoped_refptr to reset it. Just
call reset() instead. If operator=(std::nullptr_t) is added these assignments
become ambiguous.

This CL was uploaded by git cl split.

R=sadrul@chromium.org

Bug: 1024981
Change-Id: Ia7d9cd0d76794292be90704b14682ba656c45996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918148
Auto-Submit: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716476}
parent cd6ec21e
...@@ -167,7 +167,7 @@ void WrappedTask::RemoveFromTaskRunnerQueue() { ...@@ -167,7 +167,7 @@ void WrappedTask::RemoveFromTaskRunnerQueue() {
pumpable_task_runner_->task_queue_.erase(iterator_); pumpable_task_runner_->task_queue_.erase(iterator_);
iterator_ = pumpable_task_runner_->task_queue_.end(); iterator_ = pumpable_task_runner_->task_queue_.end();
} }
pumpable_task_runner_ = NULL; pumpable_task_runner_.reset();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -1706,7 +1706,7 @@ TEST(LayerAnimatorTest, AddObserverExplicit) { ...@@ -1706,7 +1706,7 @@ TEST(LayerAnimatorTest, AddObserverExplicit) {
animator->StartAnimation(sequence); animator->StartAnimation(sequence);
animator = NULL; animator.reset();
EXPECT_EQ(observer.last_aborted_sequence(), sequence); EXPECT_EQ(observer.last_aborted_sequence(), sequence);
} }
...@@ -2366,7 +2366,7 @@ TEST(LayerAnimatorTest, ImplicitObserversAtAnimatorDestruction) { ...@@ -2366,7 +2366,7 @@ TEST(LayerAnimatorTest, ImplicitObserversAtAnimatorDestruction) {
EXPECT_FALSE(observer_notify.animations_completed()); EXPECT_FALSE(observer_notify.animations_completed());
EXPECT_FALSE(observer_do_not_notify.animations_completed()); EXPECT_FALSE(observer_do_not_notify.animations_completed());
animator = NULL; animator.reset();
EXPECT_TRUE(observer_notify.animations_completed()); EXPECT_TRUE(observer_notify.animations_completed());
EXPECT_TRUE(observer_notify.WasAnimationAbortedForProperty( EXPECT_TRUE(observer_notify.WasAnimationAbortedForProperty(
LayerAnimationElement::BRIGHTNESS)); LayerAnimationElement::BRIGHTNESS));
......
...@@ -336,7 +336,7 @@ InProcessContextFactory::SharedMainThreadContextProvider() { ...@@ -336,7 +336,7 @@ InProcessContextFactory::SharedMainThreadContextProvider() {
&gpu_memory_buffer_manager_, &image_factory_, support_locking); &gpu_memory_buffer_manager_, &image_factory_, support_locking);
auto result = shared_main_thread_contexts_->BindToCurrentThread(); auto result = shared_main_thread_contexts_->BindToCurrentThread();
if (result != gpu::ContextResult::kSuccess) if (result != gpu::ContextResult::kSuccess)
shared_main_thread_contexts_ = NULL; shared_main_thread_contexts_.reset();
return shared_main_thread_contexts_; return shared_main_thread_contexts_;
} }
......
...@@ -497,7 +497,7 @@ void ImageSkia::RemoveUnsupportedRepresentationsForScale(float scale) { ...@@ -497,7 +497,7 @@ void ImageSkia::RemoveUnsupportedRepresentationsForScale(float scale) {
void ImageSkia::Init(const ImageSkiaRep& image_rep) { void ImageSkia::Init(const ImageSkiaRep& image_rep) {
if (image_rep.GetBitmap().drawsNothing()) { if (image_rep.GetBitmap().drawsNothing()) {
storage_ = NULL; storage_.reset();
return; return;
} }
storage_ = new internal::ImageSkiaStorage( storage_ = new internal::ImageSkiaStorage(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment