From b04415c9c7edc9a9474ee4d59956fd01798eb302 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Tue, 8 Sep 2015 16:59:47 +0000 Subject: Revert "chromeos-dbus-bindings: remove object proxy from bus in proxy destructor" This reverts commit a31c5257ce2673c8cdcb8e43e2a1dd40e926009d. The original CL breaks some system services (such as crash_reporter) in Chrome OS. Instead, fix the original issue by explicitly calling XXXProxy::ReleaseObjectProxy. BUG=23560086 Change-Id: I90c7c1cecc5132bd3d78be77cbe79ad45f41a99d --- chromeos-dbus-bindings/proxy_generator.cc | 6 ------ chromeos-dbus-bindings/proxy_generator_unittest.cc | 16 ---------------- 2 files changed, 22 deletions(-) (limited to 'chromeos-dbus-bindings') diff --git a/chromeos-dbus-bindings/proxy_generator.cc b/chromeos-dbus-bindings/proxy_generator.cc index 396c3d0..717740d 100644 --- a/chromeos-dbus-bindings/proxy_generator.cc +++ b/chromeos-dbus-bindings/proxy_generator.cc @@ -399,12 +399,6 @@ void ProxyGenerator::AddDestructor(const string& class_name, IndentedText* text) { IndentedText block; block.AddLine(StringPrintf("~%s() override {", class_name.c_str())); - block.PushOffset(kBlockOffset); - block.AddLine("bus_->RemoveObjectProxy("); - block.AddLineWithOffset( - "service_name_, object_path_, base::Bind(&base::DoNothing));", - kLineContinuationOffset); - block.PopOffset(); block.AddLine("}"); text->AddBlock(block); } diff --git a/chromeos-dbus-bindings/proxy_generator_unittest.cc b/chromeos-dbus-bindings/proxy_generator_unittest.cc index 9eb930f..75b7e9f 100644 --- a/chromeos-dbus-bindings/proxy_generator_unittest.cc +++ b/chromeos-dbus-bindings/proxy_generator_unittest.cc @@ -138,8 +138,6 @@ class TestInterfaceProxy final : public TestInterfaceProxyInterface { } ~TestInterfaceProxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void RegisterCloserSignalHandler( @@ -350,8 +348,6 @@ class TestInterface2Proxy final : public TestInterface2ProxyInterface { } ~TestInterface2Proxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void ReleaseObjectProxy(const base::Closure& callback) { @@ -456,8 +452,6 @@ class TestInterfaceProxy final : public TestInterfaceProxyInterface { } ~TestInterfaceProxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void RegisterCloserSignalHandler( @@ -521,8 +515,6 @@ class TestInterface2Proxy final : public TestInterface2ProxyInterface { } ~TestInterface2Proxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void ReleaseObjectProxy(const base::Closure& callback) { @@ -629,8 +621,6 @@ class Itf1Proxy final : public Itf1ProxyInterface { } ~Itf1Proxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void RegisterCloserSignalHandler( @@ -730,8 +720,6 @@ class Itf2Proxy final : public Itf2ProxyInterface { } ~Itf2Proxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void ReleaseObjectProxy(const base::Closure& callback) { @@ -1005,8 +993,6 @@ class Itf1Proxy final : public Itf1ProxyInterface { } ~Itf1Proxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void RegisterCloserSignalHandler( @@ -1084,8 +1070,6 @@ class Itf2Proxy final : public Itf2ProxyInterface { } ~Itf2Proxy() override { - bus_->RemoveObjectProxy( - service_name_, object_path_, base::Bind(&base::DoNothing)); } void ReleaseObjectProxy(const base::Closure& callback) { -- cgit v1.2.3