Commit efcfd74b 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=odejesush@chromium.org

Bug: 1024981
Change-Id: I24b8ae005c530c473b32745f398319db3fe39dcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918320
Auto-Submit: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarOvidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715687}
parent 1318353f
......@@ -135,7 +135,7 @@ void BluetoothSocketNet::DoClose() {
// Note: Closing |tcp_socket_| above released all potential pending
// Send/Receive operations, so we can no safely release the state associated
// to those pending operations.
read_buffer_ = NULL;
read_buffer_.reset();
base::queue<std::unique_ptr<WriteRequest>> empty;
std::swap(write_queue_, empty);
......
......@@ -25,7 +25,7 @@ scoped_refptr<BluetoothSocketThread> BluetoothSocketThread::Get() {
// static
void BluetoothSocketThread::CleanupForTesting() {
DCHECK(g_instance.Get().get());
g_instance.Get() = NULL;
g_instance.Get().reset();
}
BluetoothSocketThread::BluetoothSocketThread()
......@@ -35,7 +35,7 @@ BluetoothSocketThread::~BluetoothSocketThread() {
if (thread_) {
thread_->Stop();
thread_.reset(NULL);
task_runner_ = NULL;
task_runner_.reset();
}
}
......
......@@ -139,7 +139,7 @@ class BluetoothGattBlueZTest : public testing::Test {
}
void TearDown() override {
adapter_ = NULL;
adapter_.reset();
update_sessions_.clear();
gatt_conn_.reset();
bluez::BluezDBusManager::Shutdown();
......@@ -589,7 +589,7 @@ TEST_F(BluetoothGattBlueZTest, GattServiceAddedAndRemoved) {
TEST_F(BluetoothGattBlueZTest, ServicesDiscoveredBeforeAdapterIsCreated) {
// Tests that all GATT objects are created for a device whose D-Bus objects
// were already exposed and for which services have been resolved.
adapter_ = NULL;
adapter_.reset();
ASSERT_FALSE(device::BluetoothAdapterFactory::HasSharedInstanceForTesting());
// Create the fake D-Bus objects.
......@@ -685,7 +685,7 @@ TEST_F(BluetoothGattBlueZTest, DiscoverCachedServices) {
// This unit test tests that all remote GATT objects are created for D-Bus
// objects that were already exposed and all relevant events have been
// dispatched.
adapter_ = NULL;
adapter_.reset();
ASSERT_FALSE(device::BluetoothAdapterFactory::HasSharedInstanceForTesting());
// Create the fake D-Bus objects.
......@@ -774,7 +774,7 @@ TEST_F(BluetoothGattBlueZTest, DiscoverNewServices) {
TEST_F(BluetoothGattBlueZTest, DiscoverCachedAndNewServices) {
// This unit test tests that all remote GATT objects are created for D-Bus
// objects that were already exposed and for new GATT Objects.
adapter_ = NULL;
adapter_.reset();
ASSERT_FALSE(device::BluetoothAdapterFactory::HasSharedInstanceForTesting());
// Create the fake D-Bus objects.
......
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