Commit a50ab4ae authored by davemoore's avatar davemoore Committed by Commit bot

Remove ShellPtrWatcher details from public header

BUG=

Review URL: https://codereview.chromium.org/535543002

Cr-Commit-Position: refs/heads/master@{#293000}
parent 42cab11e
......@@ -70,15 +70,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
}
private:
class ShellPtrWatcher : public ErrorHandler {
public:
explicit ShellPtrWatcher(ApplicationImpl* impl);
virtual ~ShellPtrWatcher();
virtual void OnConnectionError() MOJO_OVERRIDE;
private:
ApplicationImpl* impl_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher);
};
class ShellPtrWatcher;
void BindShell(ScopedMessagePipeHandle shell_handle);
void ClearConnections();
......@@ -99,7 +91,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
ServiceRegistryList outgoing_service_registries_;
ApplicationDelegate* delegate_;
ShellPtr shell_;
ShellPtrWatcher shell_watch_;
ShellPtrWatcher* shell_watch_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
};
......
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment