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> { ...@@ -70,15 +70,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
} }
private: private:
class ShellPtrWatcher : public ErrorHandler { class ShellPtrWatcher;
public:
explicit ShellPtrWatcher(ApplicationImpl* impl);
virtual ~ShellPtrWatcher();
virtual void OnConnectionError() MOJO_OVERRIDE;
private:
ApplicationImpl* impl_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher);
};
void BindShell(ScopedMessagePipeHandle shell_handle); void BindShell(ScopedMessagePipeHandle shell_handle);
void ClearConnections(); void ClearConnections();
...@@ -99,7 +91,7 @@ class ApplicationImpl : public InterfaceImpl<Application> { ...@@ -99,7 +91,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
ServiceRegistryList outgoing_service_registries_; ServiceRegistryList outgoing_service_registries_;
ApplicationDelegate* delegate_; ApplicationDelegate* delegate_;
ShellPtr shell_; ShellPtr shell_;
ShellPtrWatcher shell_watch_; ShellPtrWatcher* shell_watch_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
}; };
......
...@@ -10,24 +10,31 @@ ...@@ -10,24 +10,31 @@
namespace mojo { namespace mojo {
ApplicationImpl::ShellPtrWatcher::ShellPtrWatcher(ApplicationImpl* impl) class ApplicationImpl::ShellPtrWatcher : public ErrorHandler {
public:
ShellPtrWatcher(ApplicationImpl* impl)
: impl_(impl) {} : impl_(impl) {}
ApplicationImpl::ShellPtrWatcher::~ShellPtrWatcher() {} virtual ~ShellPtrWatcher() {}
void ApplicationImpl::ShellPtrWatcher::OnConnectionError() { virtual void OnConnectionError() MOJO_OVERRIDE {
impl_->OnShellError(); impl_->OnShellError();
} }
private:
ApplicationImpl* impl_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher);
};
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
ScopedMessagePipeHandle shell_handle) ScopedMessagePipeHandle shell_handle)
: delegate_(delegate), shell_watch_(this) { : delegate_(delegate), shell_watch_(NULL) {
BindShell(shell_handle.Pass()); BindShell(shell_handle.Pass());
} }
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
MojoHandle shell_handle) MojoHandle shell_handle)
: delegate_(delegate), shell_watch_(this) { : delegate_(delegate), shell_watch_(NULL) {
BindShell(MakeScopedHandle(MessagePipeHandle(shell_handle))); BindShell(MakeScopedHandle(MessagePipeHandle(shell_handle)));
} }
...@@ -44,6 +51,7 @@ void ApplicationImpl::ClearConnections() { ...@@ -44,6 +51,7 @@ void ApplicationImpl::ClearConnections() {
ApplicationImpl::~ApplicationImpl() { ApplicationImpl::~ApplicationImpl() {
ClearConnections(); ClearConnections();
delete shell_watch_;
} }
ApplicationConnection* ApplicationImpl::ConnectToApplication( ApplicationConnection* ApplicationImpl::ConnectToApplication(
...@@ -63,9 +71,10 @@ ApplicationConnection* ApplicationImpl::ConnectToApplication( ...@@ -63,9 +71,10 @@ ApplicationConnection* ApplicationImpl::ConnectToApplication(
} }
void ApplicationImpl::BindShell(ScopedMessagePipeHandle shell_handle) { void ApplicationImpl::BindShell(ScopedMessagePipeHandle shell_handle) {
shell_watch_ = new ShellPtrWatcher(this);
shell_.Bind(shell_handle.Pass()); shell_.Bind(shell_handle.Pass());
shell_.set_client(this); shell_.set_client(this);
shell_.set_error_handler(&shell_watch_); shell_.set_error_handler(shell_watch_);
delegate_->Initialize(this); 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