diff options
author | Alex Vakulenko <avakulenko@chromium.org> | 2015-04-24 18:09:32 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-29 01:49:26 +0000 |
commit | 6cc1d5b99f6994832595c4d0a788972e65a6ef54 (patch) | |
tree | f98dc1d9b49c74303308b5b5bba0712624f77f73 | |
parent | b000aae2c03cc3fa6980f57993a52a81363b3518 (diff) | |
download | dbus-binding-generator-6cc1d5b99f6994832595c4d0a788972e65a6ef54.tar.gz |
libchromeos: Replace scoped_ptr with std::unique_ptr in D-Bus method handlers
Changed callbacks to use std::unique_ptr in D-Bus method handlers instead of
scoped_ptr, now that we can do this with base::Callback.
This eliminates the need to mix scoped_ptr and std::unique_ptr in the same
translation unit.
Sweep the code in the rest of platform2 that used libchromeos's D-Bus framework.
BUG=None
TEST=`FEATURES=test emerge-link libchromeos apmanager attestation buffet chromeos-dbus-bindings`
Change-Id: I50289198ef9ab183d5bc7d0c8cc7a8f53085e5a4
Reviewed-on: https://chromium-review.googlesource.com/267337
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
-rw-r--r-- | chromeos-dbus-bindings/adaptor_generator.cc | 3 | ||||
-rw-r--r-- | chromeos-dbus-bindings/adaptor_generator_unittest.cc | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/chromeos-dbus-bindings/adaptor_generator.cc b/chromeos-dbus-bindings/adaptor_generator.cc index 97c4a8b..44897a1 100644 --- a/chromeos-dbus-bindings/adaptor_generator.cc +++ b/chromeos-dbus-bindings/adaptor_generator.cc @@ -271,7 +271,8 @@ void AdaptorGenerator::AddInterfaceMethods(const Interface& interface, out_types.push_back(param_type); } method_params.push_back(base::StringPrintf( - "scoped_ptr<chromeos::dbus_utils::DBusMethodResponse<%s>> response", + "std::unique_ptr<chromeos::dbus_utils::DBusMethodResponse<%s>> " + "response", chromeos::string_utils::Join(", ", out_types).c_str())); if (method.include_dbus_message) method_params.push_back("dbus::Message* message"); diff --git a/chromeos-dbus-bindings/adaptor_generator_unittest.cc b/chromeos-dbus-bindings/adaptor_generator_unittest.cc index 772552d..6fe34bb 100644 --- a/chromeos-dbus-bindings/adaptor_generator_unittest.cc +++ b/chromeos-dbus-bindings/adaptor_generator_unittest.cc @@ -179,10 +179,10 @@ class Test2Interface { virtual std::string Kaneda2( const std::string& in_iwata) const = 0; virtual void Tetsuo2( - scoped_ptr<chromeos::dbus_utils::DBusMethodResponse<int64_t>> response, + std::unique_ptr<chromeos::dbus_utils::DBusMethodResponse<int64_t>> response, int32_t in_1) = 0; virtual void Kei2( - scoped_ptr<chromeos::dbus_utils::DBusMethodResponse<bool>> response, + std::unique_ptr<chromeos::dbus_utils::DBusMethodResponse<bool>> response, dbus::Message* message) = 0; }; |