diff options
author | Alex Deymo <deymo@chromium.org> | 2015-06-19 20:55:14 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-22 19:27:51 +0000 |
commit | 168561072be5df28a2491252984095ff3a3a77f4 (patch) | |
tree | 49a4acf9d881244a49c3ed2d6b4268bb9865101b | |
parent | 0bd7dd71a61171d9609ecc7722e8fd87e0afdda2 (diff) | |
download | dbus-binding-generator-168561072be5df28a2491252984095ff3a3a77f4.tar.gz |
chromeos-dbus-bindings: Make Interface destructor virtual.
As required per style and to support using -Wnon-virtual-dtor on generated
code, this patch makes the protected destructor virtual on the proxy
interface.
BUG=None
TEST=sudo env FEATURES=test emerge chromeos-dbus-bindings; update_engine_client compiles with -Wnon-virtual-dtor.
Change-Id: I9904cf823e5e3fc028ab870adbbbd26a3f0da44b
Reviewed-on: https://chromium-review.googlesource.com/280877
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
-rw-r--r-- | chromeos-dbus-bindings/proxy_generator.cc | 4 | ||||
-rw-r--r-- | chromeos-dbus-bindings/proxy_generator_unittest.cc | 32 |
2 files changed, 18 insertions, 18 deletions
diff --git a/chromeos-dbus-bindings/proxy_generator.cc b/chromeos-dbus-bindings/proxy_generator.cc index 0921ae4..24b61af 100644 --- a/chromeos-dbus-bindings/proxy_generator.cc +++ b/chromeos-dbus-bindings/proxy_generator.cc @@ -201,7 +201,7 @@ void ProxyGenerator::GenerateInterfaceProxyInterface( text->PopOffset(); text->AddLineWithOffset("protected:", kScopeOffset); text->AddLineWithOffset( - StringPrintf("~%s() = default;", base_interface_name.c_str()), + StringPrintf("virtual ~%s() = default;", base_interface_name.c_str()), kBlockOffset); text->AddLine("};"); text->AddBlankLine(); @@ -382,7 +382,7 @@ void ProxyGenerator::AddConstructor(const ServiceConfig& config, void ProxyGenerator::AddDestructor(const string& class_name, IndentedText* text) { IndentedText block; - block.AddLine(StringPrintf("~%s() {", class_name.c_str())); + block.AddLine(StringPrintf("~%s() override {", class_name.c_str())); block.AddLine("}"); block.AddBlankLine(); text->AddBlock(block); diff --git a/chromeos-dbus-bindings/proxy_generator_unittest.cc b/chromeos-dbus-bindings/proxy_generator_unittest.cc index 165d068..653bb8e 100644 --- a/chromeos-dbus-bindings/proxy_generator_unittest.cc +++ b/chromeos-dbus-bindings/proxy_generator_unittest.cc @@ -107,7 +107,7 @@ class TestInterfaceProxyInterface { int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; protected: - ~TestInterfaceProxyInterface() = default; + virtual ~TestInterfaceProxyInterface() = default; }; } // namespace chromium @@ -128,7 +128,7 @@ class TestInterfaceProxy final : public TestInterfaceProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~TestInterfaceProxy() { + ~TestInterfaceProxy() override { } void RegisterCloserSignalHandler( @@ -316,7 +316,7 @@ class TestInterface2ProxyInterface { int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; protected: - ~TestInterface2ProxyInterface() = default; + virtual ~TestInterface2ProxyInterface() = default; }; } // namespace chromium @@ -339,7 +339,7 @@ class TestInterface2Proxy final : public TestInterface2ProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~TestInterface2Proxy() { + ~TestInterface2Proxy() override { } void ReleaseObjectProxy(const base::Closure& callback) { @@ -422,7 +422,7 @@ namespace chromium { class TestInterfaceProxyInterface { public: protected: - ~TestInterfaceProxyInterface() = default; + virtual ~TestInterfaceProxyInterface() = default; }; } // namespace chromium @@ -440,7 +440,7 @@ class TestInterfaceProxy final : public TestInterfaceProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~TestInterfaceProxy() { + ~TestInterfaceProxy() override { } void RegisterCloserSignalHandler( @@ -483,7 +483,7 @@ namespace chromium { class TestInterface2ProxyInterface { public: protected: - ~TestInterface2ProxyInterface() = default; + virtual ~TestInterface2ProxyInterface() = default; }; } // namespace chromium @@ -504,7 +504,7 @@ class TestInterface2Proxy final : public TestInterface2ProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~TestInterface2Proxy() { + ~TestInterface2Proxy() override { } void ReleaseObjectProxy(const base::Closure& callback) { @@ -568,7 +568,7 @@ class Itf1ProxyInterface { virtual const std::string& data() const = 0; protected: - ~Itf1ProxyInterface() = default; + virtual ~Itf1ProxyInterface() = default; }; } // namespace chromium @@ -607,7 +607,7 @@ class Itf1Proxy final : public Itf1ProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~Itf1Proxy() { + ~Itf1Proxy() override { } void RegisterCloserSignalHandler( @@ -670,7 +670,7 @@ namespace chromium { class Itf2ProxyInterface { public: protected: - ~Itf2ProxyInterface() = default; + virtual ~Itf2ProxyInterface() = default; }; } // namespace chromium @@ -707,7 +707,7 @@ class Itf2Proxy final : public Itf2ProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~Itf2Proxy() { + ~Itf2Proxy() override { } void ReleaseObjectProxy(const base::Closure& callback) { @@ -945,7 +945,7 @@ namespace chromium { class Itf1ProxyInterface { public: protected: - ~Itf1ProxyInterface() = default; + virtual ~Itf1ProxyInterface() = default; }; } // namespace chromium @@ -977,7 +977,7 @@ class Itf1Proxy final : public Itf1ProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~Itf1Proxy() { + ~Itf1Proxy() override { } void RegisterCloserSignalHandler( @@ -1020,7 +1020,7 @@ namespace chromium { class Itf2ProxyInterface { public: protected: - ~Itf2ProxyInterface() = default; + virtual ~Itf2ProxyInterface() = default; }; } // namespace chromium @@ -1055,7 +1055,7 @@ class Itf2Proxy final : public Itf2ProxyInterface { bus_->GetObjectProxy(service_name_, object_path_)} { } - ~Itf2Proxy() { + ~Itf2Proxy() override { } void ReleaseObjectProxy(const base::Closure& callback) { |