Commit a8107cd6 authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in device/

This patch was generated by running the rewrite_scoped_refptr clang tool
on a Linux build.

BUG=110610

Review URL: https://codereview.chromium.org/507053002

Cr-Commit-Position: refs/heads/master@{#292298}
parent 2accd776
......@@ -258,7 +258,7 @@ void BluetoothSocketNet::SendFrontWriteRequest() {
request->success_callback,
request->error_callback);
int send_result =
tcp_socket_->Write(request->buffer, request->buffer_size, callback);
tcp_socket_->Write(request->buffer.get(), request->buffer_size, callback);
if (send_result != net::ERR_IO_PENDING) {
callback.Run(send_result);
}
......
......@@ -23,7 +23,7 @@ scoped_refptr<BluetoothSocketThread> BluetoothSocketThread::Get() {
// static
void BluetoothSocketThread::CleanupForTesting() {
DCHECK(g_instance.Get());
DCHECK(g_instance.Get().get());
g_instance.Get() = NULL;
}
......@@ -70,7 +70,7 @@ scoped_refptr<base::SequencedTaskRunner> BluetoothSocketThread::task_runner()
const {
DCHECK(active_socket_count_ > 0);
DCHECK(thread_);
DCHECK(task_runner_);
DCHECK(task_runner_.get());
return task_runner_;
}
......
......@@ -127,7 +127,7 @@ TEST_F(HidConnectionTest, ReadWrite) {
if (!UsbTestGadget::IsTestEnabled()) return;
scoped_refptr<HidConnection> conn = service_->Connect(device_id_);
ASSERT_TRUE(conn);
ASSERT_TRUE(conn.get());
for (int i = 0; i < 8; ++i) {
scoped_refptr<IOBufferWithSize> buffer(new IOBufferWithSize(9));
......
......@@ -241,7 +241,7 @@ DataSinkReceiver::Buffer::Buffer(scoped_refptr<DataSinkReceiver> receiver,
}
DataSinkReceiver::Buffer::~Buffer() {
if (!receiver_)
if (!receiver_.get())
return;
if (cancelled_)
receiver_->DoneWithError(0, cancellation_error_);
......
......@@ -50,7 +50,7 @@ class DataSinkTest : public testing::Test {
virtual void TearDown() OVERRIDE {
read_buffer_.reset();
message_loop_.reset();
if (sink_receiver_)
if (sink_receiver_.get())
EXPECT_TRUE(sink_receiver_->HasOneRef());
}
......
......@@ -214,7 +214,7 @@ DataSourceSender::PendingSend::Buffer::Buffer(
}
DataSourceSender::PendingSend::Buffer::~Buffer() {
if (sender_)
if (sender_.get())
pending_send_->Done(0);
}
......@@ -227,7 +227,7 @@ uint32_t DataSourceSender::PendingSend::Buffer::GetSize() {
}
void DataSourceSender::PendingSend::Buffer::Done(uint32_t bytes_written) {
DCHECK(sender_);
DCHECK(sender_.get());
pending_send_->Done(bytes_written);
sender_ = NULL;
pending_send_ = NULL;
......@@ -238,7 +238,7 @@ void DataSourceSender::PendingSend::Buffer::Done(uint32_t bytes_written) {
void DataSourceSender::PendingSend::Buffer::DoneWithError(
uint32_t bytes_written,
int32_t error) {
DCHECK(sender_);
DCHECK(sender_.get());
pending_send_->DoneWithError(bytes_written, error);
sender_ = NULL;
pending_send_ = NULL;
......
......@@ -114,7 +114,7 @@ void SerialConnectionFactory::ConnectTask::Connect() {
}
void SerialConnectionFactory::ConnectTask::OnConnected(bool success) {
DCHECK(io_handler_);
DCHECK(io_handler_.get());
if (!success)
return;
if (!options_)
......
......@@ -89,7 +89,7 @@ class SerialConnectionTest : public testing::Test, public mojo::ErrorHandler {
connection_->GetInfo(
base::Bind(&SerialConnectionTest::StoreInfo, base::Unretained(this)));
WaitForEvent(EVENT_GOT_INFO);
ASSERT_TRUE(io_handler_);
ASSERT_TRUE(io_handler_.get());
}
void StoreInfo(serial::ConnectionInfoPtr options) {
......
......@@ -26,7 +26,7 @@ void SerialIoHandler::Open(const std::string& port,
DCHECK(CalledOnValidThread());
DCHECK(open_complete_.is_null());
open_complete_ = callback;
DCHECK(file_thread_message_loop_);
DCHECK(file_thread_message_loop_.get());
file_thread_message_loop_->PostTask(
FROM_HERE,
base::Bind(&SerialIoHandler::StartOpen,
......@@ -81,7 +81,7 @@ bool SerialIoHandler::PostOpen() {
void SerialIoHandler::Close() {
if (file_.IsValid()) {
DCHECK(file_thread_message_loop_);
DCHECK(file_thread_message_loop_.get());
file_thread_message_loop_->PostTask(
FROM_HERE, base::Bind(&SerialIoHandler::DoClose, Passed(file_.Pass())));
}
......
......@@ -70,7 +70,7 @@ class SerialServiceTest : public testing::Test, public mojo::ErrorHandler {
scoped_refptr<SerialIoHandler> ReturnIoHandler() { return io_handler_; }
void RunConnectTest(const std::string& path, bool expecting_success) {
if (!io_handler_)
if (!io_handler_.get())
io_handler_ = new TestSerialIoHandler;
mojo::InterfacePtr<serial::SerialService> service;
mojo::BindToProxy(
......
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