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

Unified Diff: services/console/console.cc

Issue 937863004: Revert accidental console.cc changes from 23538d3c49dfaff28e4d88b3254b7ab8cf1b6e35 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/console/console.cc
diff --git a/services/console/console.cc b/services/console/console.cc
index 06ff2acbadfa8150b44bc561d84b353c9a642b2f..ad1fc9c186333f87671fbc914ad8c49f1df1cc54 100644
--- a/services/console/console.cc
+++ b/services/console/console.cc
@@ -11,14 +11,15 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/interface_factory.h"
-#include "mojo/public/cpp/bindings/interface_ptr.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/services/console/public/interfaces/console.mojom.h"
namespace mojo {
-class ConsoleImpl : public InterfaceImpl<Console> {
+class ConsoleImpl : public Console {
public:
- explicit ConsoleImpl(const std::string& app_name) : app_name_(app_name) {}
+ ConsoleImpl(const std::string& app_name, InterfaceRequest<Console> request)
+ : app_name_(app_name), binding_(this, request.Pass()) {}
~ConsoleImpl() override {}
void ReadLine(const Callback<void(bool, String)>& callback) override {
@@ -47,6 +48,7 @@ class ConsoleImpl : public InterfaceImpl<Console> {
private:
const std::string app_name_;
+ StrongBinding<Console> binding_;
DISALLOW_COPY_AND_ASSIGN(ConsoleImpl);
};
@@ -66,8 +68,7 @@ class ConsoleDelegate : public ApplicationDelegate,
// InterfaceFactory<Console> implementation.
void Create(ApplicationConnection* connection,
InterfaceRequest<Console> request) override {
- BindToRequest(new ConsoleImpl(connection->GetRemoteApplicationURL()),
- &request);
+ new ConsoleImpl(connection->GetRemoteApplicationURL(), request.Pass());
}
private:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698