Commit 34d0cd02 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=reillyg@chromium.org

Bug: 1024981
Change-Id: I11e16eb6457e3de133bf6528b437f0753e73b5ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918322
Auto-Submit: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715485}
parent bbd95686
......@@ -267,7 +267,7 @@ BluetoothLowEnergyEventRouter::~BluetoothLowEnergyEventRouter() {
}
adapter_->RemoveObserver(this);
adapter_ = NULL;
adapter_.reset();
}
bool BluetoothLowEnergyEventRouter::IsBluetoothSupported() const {
......
......@@ -145,7 +145,7 @@ TEST(RulesRegistryTest, FillOptionalIdentifiers) {
registry->GetNumberOfUsedRuleIdentifiersForTesting());
// Make sure that deletion traits of registry are executed.
registry = NULL;
registry.reset();
base::RunLoop().RunUntilIdle();
}
......@@ -182,7 +182,7 @@ TEST(RulesRegistryTest, FillOptionalPriority) {
std::max(*get_rules[0]->priority, *get_rules[1]->priority));
// Make sure that deletion traits of registry are executed.
registry = NULL;
registry.reset();
base::RunLoop().RunUntilIdle();
}
......
......@@ -519,7 +519,7 @@ void MockDisplaySourceConnectionDelegate::OnMediaPacketReceived(
int net_result) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(recvfrom_buffer_.get());
recvfrom_buffer_ = NULL;
recvfrom_buffer_.reset();
if (net_result > 0) {
// We received at least one media packet.
......
......@@ -64,7 +64,7 @@ void Socket::WriteData() {
}
void Socket::OnWriteComplete(int result) {
io_buffer_write_ = NULL;
io_buffer_write_.reset();
WriteRequest& request = write_queue_.front();
......
......@@ -51,7 +51,7 @@ TEST_F(InfoMapTest, RefCounting) {
// Release extension1, and the info map should have the only ref.
const Extension* weak_extension1 = extension1.get();
extension1 = NULL;
extension1.reset();
EXPECT_TRUE(weak_extension1->HasOneRef());
// Remove extension2, and the extension2 object should have the only ref.
......@@ -60,7 +60,7 @@ TEST_F(InfoMapTest, RefCounting) {
EXPECT_TRUE(extension2->HasOneRef());
// Delete the info map, and the extension3 object should have the only ref.
info_map = NULL;
info_map.reset();
EXPECT_TRUE(extension3->HasOneRef());
}
......
......@@ -938,7 +938,7 @@ void SandboxedUnpacker::ReportSuccess(
client_->OnUnpackSuccess(temp_dir_.Take(), extension_root_,
std::move(original_manifest), extension_.get(),
install_icon_, dnr_ruleset_checksum);
extension_ = NULL;
extension_.reset();
Cleanup();
}
......
......@@ -55,7 +55,7 @@ void ExtensionTestMessageListener::Reply(const std::string& message) {
replied_ = true;
function_->Reply(message);
function_ = NULL;
function_.reset();
}
void ExtensionTestMessageListener::Reply(int message) {
......@@ -68,7 +68,7 @@ void ExtensionTestMessageListener::ReplyWithError(const std::string& error) {
replied_ = true;
function_->ReplyWithError(error);
function_ = NULL;
function_.reset();
}
void ExtensionTestMessageListener::Reset() {
......
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