From e52df78a3a91d83ba947e0a65aa5f3252657adf6 Mon Sep 17 00:00:00 2001 From: "rsleevi@chromium.org" Date: Sun, 2 Jun 2013 23:38:09 +0000 Subject: Update dbus/ to use scoped_refptr::get() rather than implicit "operator T*" Linux fixes BUG=110610 TBR=darin Review URL: https://chromiumcodereview.appspot.com/15939006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203634 0039d316-1c4b-4281-b951-d872f2087c98 --- dbus/bus.cc | 6 +++--- dbus/mock_unittest.cc | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'dbus') diff --git a/dbus/bus.cc b/dbus/bus.cc index 0c8772b..3dbbedc 100644 --- a/dbus/bus.cc +++ b/dbus/bus.cc @@ -225,7 +225,7 @@ ObjectProxy* Bus::GetObjectProxyWithOptions(const std::string& service_name, options); ObjectProxyTable::iterator iter = object_proxy_table_.find(key); if (iter != object_proxy_table_.end()) { - return iter->second; + return iter->second.get(); } scoped_refptr object_proxy = @@ -281,7 +281,7 @@ ExportedObject* Bus::GetExportedObject(const ObjectPath& object_path) { // Check if we already have the requested exported object. ExportedObjectTable::iterator iter = exported_object_table_.find(object_path); if (iter != exported_object_table_.end()) { - return iter->second; + return iter->second.get(); } scoped_refptr exported_object = @@ -328,7 +328,7 @@ ObjectManager* Bus::GetObjectManager(const std::string& service_name, const ObjectManagerTable::key_type key(service_name + object_path.value()); ObjectManagerTable::iterator iter = object_manager_table_.find(key); if (iter != object_manager_table_.end()) { - return iter->second; + return iter->second.get(); } scoped_refptr object_manager = diff --git a/dbus/mock_unittest.cc b/dbus/mock_unittest.cc index c12a383..a329fe8 100644 --- a/dbus/mock_unittest.cc +++ b/dbus/mock_unittest.cc @@ -39,25 +39,23 @@ class MockTest : public testing::Test { // Set an expectation so mock_proxy's CallMethodAndBlock() will use // CreateMockProxyResponse() to return responses. - EXPECT_CALL(*mock_proxy_, MockCallMethodAndBlock(_, _)) + EXPECT_CALL(*mock_proxy_.get(), MockCallMethodAndBlock(_, _)) .WillRepeatedly(Invoke(this, &MockTest::CreateMockProxyResponse)); // Set an expectation so mock_proxy's CallMethod() will use // HandleMockProxyResponseWithMessageLoop() to return responses. - EXPECT_CALL(*mock_proxy_, CallMethod(_, _, _)) - .WillRepeatedly( - Invoke(this, - &MockTest::HandleMockProxyResponseWithMessageLoop)); + EXPECT_CALL(*mock_proxy_.get(), CallMethod(_, _, _)).WillRepeatedly( + Invoke(this, &MockTest::HandleMockProxyResponseWithMessageLoop)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_proxy_. - EXPECT_CALL(*mock_bus_, GetObjectProxy( - "org.chromium.TestService", - dbus::ObjectPath("/org/chromium/TestObject"))) + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy("org.chromium.TestService", + dbus::ObjectPath("/org/chromium/TestObject"))) .WillOnce(Return(mock_proxy_.get())); // ShutdownAndBlock() will be called in TearDown(). - EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return()); + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); } virtual void TearDown() { -- cgit v1.1