diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 07:30:38 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 07:30:38 +0000 |
commit | 144b6c4d67fe81336112e4d702fb90c7aedb9bbf (patch) | |
tree | ea4c040b17e2fdb754e0416749abd51b4937b991 /device | |
parent | 3c7ca2f02b64ba078a4aab208dc35d0a002fc168 (diff) | |
download | chromium_src-144b6c4d67fe81336112e4d702fb90c7aedb9bbf.zip chromium_src-144b6c4d67fe81336112e4d702fb90c7aedb9bbf.tar.gz chromium_src-144b6c4d67fe81336112e4d702fb90c7aedb9bbf.tar.bz2 |
Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*"
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/16998003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device')
-rw-r--r-- | device/bluetooth/bluetooth_chromeos_unittest.cc | 4 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_profile_chromeos.cc | 2 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_profile_chromeos_unittest.cc | 34 |
3 files changed, 22 insertions, 18 deletions
diff --git a/device/bluetooth/bluetooth_chromeos_unittest.cc b/device/bluetooth/bluetooth_chromeos_unittest.cc index 6020ce4..5adf2d4 100644 --- a/device/bluetooth/bluetooth_chromeos_unittest.cc +++ b/device/bluetooth/bluetooth_chromeos_unittest.cc @@ -244,7 +244,7 @@ class BluetoothChromeOSTest : public testing::Test { // Call to fill the adapter_ member with a BluetoothAdapter instance. void GetAdapter() { adapter_ = new BluetoothAdapterChromeOS(); - ASSERT_TRUE(adapter_ != NULL); + ASSERT_TRUE(adapter_.get() != NULL); ASSERT_TRUE(adapter_->IsInitialized()); } @@ -254,7 +254,7 @@ class BluetoothChromeOSTest : public testing::Test { // The correct behavior of discovery is tested by the "Discovery" test case // without using this function. void DiscoverDevice(const std::string& address) { - ASSERT_TRUE(adapter_ != NULL); + ASSERT_TRUE(adapter_.get() != NULL); if (base::MessageLoop::current() == NULL) { base::MessageLoop message_loop(base::MessageLoop::TYPE_DEFAULT); diff --git a/device/bluetooth/bluetooth_profile_chromeos.cc b/device/bluetooth/bluetooth_profile_chromeos.cc index f4b8ccc..6d0bb4e 100644 --- a/device/bluetooth/bluetooth_profile_chromeos.cc +++ b/device/bluetooth/bluetooth_profile_chromeos.cc @@ -157,7 +157,7 @@ void BluetoothProfileChromeOS::NewConnection( // base::Passed is used to take ownership of the file descriptor during the // CheckValidity() call and pass that ownership to the GetAdapter() call. base::PostTaskAndReplyWithResult( - base::WorkerPool::GetTaskRunner(false), + base::WorkerPool::GetTaskRunner(false).get(), FROM_HERE, base::Bind(&CheckValidity, base::Passed(&fd)), base::Bind(&BluetoothProfileChromeOS::GetAdapter, diff --git a/device/bluetooth/bluetooth_profile_chromeos_unittest.cc b/device/bluetooth/bluetooth_profile_chromeos_unittest.cc index 271fe46..b59a635 100644 --- a/device/bluetooth/bluetooth_profile_chromeos_unittest.cc +++ b/device/bluetooth/bluetooth_profile_chromeos_unittest.cc @@ -48,7 +48,7 @@ class BluetoothProfileChromeOSTest : public testing::Test { device::BluetoothAdapterFactory::GetAdapter( base::Bind(&BluetoothProfileChromeOSTest::AdapterCallback, base::Unretained(this))); - ASSERT_TRUE(adapter_ != NULL); + ASSERT_TRUE(adapter_.get() != NULL); ASSERT_TRUE(adapter_->IsInitialized()); ASSERT_TRUE(adapter_->IsPresent()); @@ -171,7 +171,7 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) { // Read data from the socket; since no data should be waiting, this should // return success but no data. read_buffer = new net::GrowableIOBuffer; - success = socket->Receive(read_buffer); + success = socket->Receive(read_buffer.get()); EXPECT_TRUE(success); EXPECT_EQ(0, read_buffer->capacity()); EXPECT_EQ(0, read_buffer->offset()); @@ -179,8 +179,9 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) { // Write data to the socket; the data should be consumed and no bytes should // be remaining. - write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size()); - success = socket->Send(write_buffer); + write_buffer = + new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size()); + success = socket->Send(write_buffer.get()); EXPECT_TRUE(success); EXPECT_EQ(base_buffer->size(), write_buffer->BytesConsumed()); EXPECT_EQ(0, write_buffer->BytesRemaining()); @@ -191,7 +192,7 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) { // to read. read_buffer = new net::GrowableIOBuffer; do { - success = socket->Receive(read_buffer); + success = socket->Receive(read_buffer.get()); } while (success && read_buffer->offset() == 0); EXPECT_TRUE(success); EXPECT_NE(0, read_buffer->capacity()); @@ -204,8 +205,9 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) { // Write data to the socket; since the socket is closed, this should return // an error without writing the data and "Disconnected" as the message. - write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size()); - success = socket->Send(write_buffer); + write_buffer = + new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size()); + success = socket->Send(write_buffer.get()); EXPECT_FALSE(success); EXPECT_EQ(0, write_buffer->BytesConsumed()); EXPECT_EQ(base_buffer->size(), write_buffer->BytesRemaining()); @@ -214,7 +216,7 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) { // Read data from the socket; since the socket is closed, this should return // an error with "Disconnected" as the last message. read_buffer = new net::GrowableIOBuffer; - success = socket->Receive(read_buffer); + success = socket->Receive(read_buffer.get()); EXPECT_FALSE(success); EXPECT_EQ(0, read_buffer->capacity()); EXPECT_EQ(0, read_buffer->offset()); @@ -295,15 +297,16 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) { // Read data from the socket; since no data should be waiting, this should // return success but no data. read_buffer = new net::GrowableIOBuffer; - success = socket->Receive(read_buffer); + success = socket->Receive(read_buffer.get()); EXPECT_TRUE(success); EXPECT_EQ(0, read_buffer->offset()); EXPECT_EQ("", socket->GetLastErrorMessage()); // Write data to the socket; the data should be consumed and no bytes should // be remaining. - write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size()); - success = socket->Send(write_buffer); + write_buffer = + new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size()); + success = socket->Send(write_buffer.get()); EXPECT_TRUE(success); EXPECT_EQ(base_buffer->size(), write_buffer->BytesConsumed()); EXPECT_EQ(0, write_buffer->BytesRemaining()); @@ -314,7 +317,7 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) { // to read. read_buffer = new net::GrowableIOBuffer; do { - success = socket->Receive(read_buffer); + success = socket->Receive(read_buffer.get()); } while (success && read_buffer->offset() == 0); EXPECT_TRUE(success); EXPECT_NE(0, read_buffer->capacity()); @@ -327,8 +330,9 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) { // Write data to the socket; since the socket is closed, this should return // an error without writing the data and "Disconnected" as the message. - write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size()); - success = socket->Send(write_buffer); + write_buffer = + new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size()); + success = socket->Send(write_buffer.get()); EXPECT_FALSE(success); EXPECT_EQ(0, write_buffer->BytesConsumed()); EXPECT_EQ(base_buffer->size(), write_buffer->BytesRemaining()); @@ -337,7 +341,7 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) { // Read data from the socket; since the socket is closed, this should return // an error with "Disconnected" as the last message. read_buffer = new net::GrowableIOBuffer; - success = socket->Receive(read_buffer); + success = socket->Receive(read_buffer.get()); EXPECT_FALSE(success); EXPECT_EQ(0, read_buffer->offset()); EXPECT_EQ("Disconnected", socket->GetLastErrorMessage()); |