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

Unified Diff: services/console/console.cc

Issue 926093003: AddOriginMapping() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Comments 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 | shell/context.cc » ('j') | shell/switches.cc » ('J')
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 ad1fc9c186333f87671fbc914ad8c49f1df1cc54..06ff2acbadfa8150b44bc561d84b353c9a642b2f 100644
--- a/services/console/console.cc
+++ b/services/console/console.cc
@@ -11,15 +11,14 @@
#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/strong_binding.h"
+#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "mojo/services/console/public/interfaces/console.mojom.h"
namespace mojo {
-class ConsoleImpl : public Console {
+class ConsoleImpl : public InterfaceImpl<Console> {
public:
- ConsoleImpl(const std::string& app_name, InterfaceRequest<Console> request)
- : app_name_(app_name), binding_(this, request.Pass()) {}
+ explicit ConsoleImpl(const std::string& app_name) : app_name_(app_name) {}
~ConsoleImpl() override {}
void ReadLine(const Callback<void(bool, String)>& callback) override {
@@ -48,7 +47,6 @@ class ConsoleImpl : public Console {
private:
const std::string app_name_;
- StrongBinding<Console> binding_;
DISALLOW_COPY_AND_ASSIGN(ConsoleImpl);
};
@@ -68,7 +66,8 @@ class ConsoleDelegate : public ApplicationDelegate,
// InterfaceFactory<Console> implementation.
void Create(ApplicationConnection* connection,
InterfaceRequest<Console> request) override {
- new ConsoleImpl(connection->GetRemoteApplicationURL(), request.Pass());
+ BindToRequest(new ConsoleImpl(connection->GetRemoteApplicationURL()),
+ &request);
}
private:
« no previous file with comments | « no previous file | shell/context.cc » ('j') | shell/switches.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698