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

Unified Diff: mojo/public/cpp/application/lib/application_impl.cc

Issue 535543002: Remove ShellPtrWatcher details from public header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « mojo/public/cpp/application/application_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/lib/application_impl.cc
diff --git a/mojo/public/cpp/application/lib/application_impl.cc b/mojo/public/cpp/application/lib/application_impl.cc
index f47b58fdf3a538c523c24c37d1bca864d75d24bb..469ba3a9417f242f218b274c707892ff740b70e2 100644
--- a/mojo/public/cpp/application/lib/application_impl.cc
+++ b/mojo/public/cpp/application/lib/application_impl.cc
@@ -10,24 +10,31 @@
namespace mojo {
-ApplicationImpl::ShellPtrWatcher::ShellPtrWatcher(ApplicationImpl* impl)
+class ApplicationImpl::ShellPtrWatcher : public ErrorHandler {
+ public:
+ ShellPtrWatcher(ApplicationImpl* impl)
: impl_(impl) {}
-ApplicationImpl::ShellPtrWatcher::~ShellPtrWatcher() {}
+ virtual ~ShellPtrWatcher() {}
-void ApplicationImpl::ShellPtrWatcher::OnConnectionError() {
- impl_->OnShellError();
-}
+ virtual void OnConnectionError() MOJO_OVERRIDE {
+ impl_->OnShellError();
+ }
+
+ private:
+ ApplicationImpl* impl_;
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher);
+};
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
ScopedMessagePipeHandle shell_handle)
- : delegate_(delegate), shell_watch_(this) {
+ : delegate_(delegate), shell_watch_(NULL) {
BindShell(shell_handle.Pass());
}
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
MojoHandle shell_handle)
- : delegate_(delegate), shell_watch_(this) {
+ : delegate_(delegate), shell_watch_(NULL) {
BindShell(MakeScopedHandle(MessagePipeHandle(shell_handle)));
}
@@ -44,6 +51,7 @@ void ApplicationImpl::ClearConnections() {
ApplicationImpl::~ApplicationImpl() {
ClearConnections();
+ delete shell_watch_;
}
ApplicationConnection* ApplicationImpl::ConnectToApplication(
@@ -63,9 +71,10 @@ ApplicationConnection* ApplicationImpl::ConnectToApplication(
}
void ApplicationImpl::BindShell(ScopedMessagePipeHandle shell_handle) {
+ shell_watch_ = new ShellPtrWatcher(this);
shell_.Bind(shell_handle.Pass());
shell_.set_client(this);
- shell_.set_error_handler(&shell_watch_);
+ shell_.set_error_handler(shell_watch_);
delegate_->Initialize(this);
}
« no previous file with comments | « mojo/public/cpp/application/application_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698