diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2016-05-26 15:51:35 -0700 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2016-05-26 15:51:35 -0700 |
commit | b4ee324d707fa8cb45c38670c631870d5c5931dd (patch) | |
tree | 413509a9b8dec4b9e262d32cc2ccc99252284115 | |
parent | 9aa94ce9ee7680ca776483a5215b7d74bedc38f7 (diff) | |
download | common-b4ee324d707fa8cb45c38670c631870d5c5931dd.tar.gz |
dbus_example: Update libchrome APIs to r395517
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
BUG=28985443
Change-Id: I2c62cf4a33e45cf05a8625a489f262072d876589
-rw-r--r-- | dbus_example/dbus-example-client.cc | 4 | ||||
-rw-r--r-- | dbus_example/dbus-example-daemon.cc | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/dbus_example/dbus-example-client.cc b/dbus_example/dbus-example-client.cc index b28e2ba..171bc6f 100644 --- a/dbus_example/dbus-example-client.cc +++ b/dbus_example/dbus-example-client.cc @@ -16,6 +16,8 @@ #include <unistd.h> +#include <memory> + #include <dbus/bus.h> #include <dbus/message.h> #include <dbus/object_proxy.h> @@ -44,7 +46,7 @@ int main(int argc, char *argv[]) { writer.AppendInt32(token); ALOGI("Calling %s with %d", dbus_example::kMethodName, token); - scoped_ptr<dbus::Response> response( + std::unique_ptr<dbus::Response> response( proxy->CallMethodAndBlock( &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)); if (!response) { diff --git a/dbus_example/dbus-example-daemon.cc b/dbus_example/dbus-example-daemon.cc index 178a610..6a069e1 100644 --- a/dbus_example/dbus-example-daemon.cc +++ b/dbus_example/dbus-example-daemon.cc @@ -14,10 +14,11 @@ * limitations under the License. */ +#include <memory> + #include <base/at_exit.h> #include <base/bind.h> #include <base/memory/ref_counted.h> -#include <base/memory/scoped_ptr.h> #include <base/message_loop/message_loop.h> #include <base/run_loop.h> #include <dbus/bus.h> @@ -64,13 +65,13 @@ class Daemon { dbus::MessageReader reader(method_call); if (!reader.PopInt32(&token)) { ALOGE("Request didn't have token"); - response_sender.Run(scoped_ptr<dbus::Response>( + response_sender.Run(std::unique_ptr<dbus::Response>( dbus::ErrorResponse::FromMethodCall(method_call, DBUS_ERROR_INVALID_ARGS, "Expected token argument"))); return; } - scoped_ptr<dbus::Response> response = + std::unique_ptr<dbus::Response> response = dbus::Response::FromMethodCall(method_call); dbus::MessageWriter writer(response.get()); writer.AppendInt32(token); |