Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: mojo/examples/dbus_echo/dbus_echo_app.cc

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/examples/dbus_echo/dbus_echo_app.cc
diff --git a/mojo/examples/dbus_echo/dbus_echo_app.cc b/mojo/examples/dbus_echo/dbus_echo_app.cc
index 13bf8e02499d8cbe17d547c33216e04f0e835240..c9a79618406913117a41daaa4bf62c95ac817aaf 100644
--- a/mojo/examples/dbus_echo/dbus_echo_app.cc
+++ b/mojo/examples/dbus_echo/dbus_echo_app.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/logging.h"
-#include "mojo/public/cpp/bindings/allocation_scope.h"
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/shell/application.h"
#include "mojo/public/cpp/system/core.h"
@@ -35,17 +34,17 @@ class DBusEchoApp : public Application {
ConnectTo("dbus:org.chromium.EchoService/org/chromium/MojoImpl",
&echo_service_);
- AllocationScope scope;
- echo_service_->Echo("who", base::Bind(&DBusEchoApp::OnEcho,
- base::Unretained(this)));
+ echo_service_->Echo(
+ String::From("who"),
+ base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this)));
}
virtual ~DBusEchoApp() {
}
private:
- void OnEcho(const String& echoed) {
- LOG(INFO) << "echo'd " << echoed.To<std::string>();
+ void OnEcho(String echoed) {
+ LOG(INFO) << "echo'd " << echoed;
}
EchoServicePtr echo_service_;

Powered by Google App Engine
This is Rietveld 408576698