Index: content/renderer/web_ui_setup_impl.cc |
diff --git a/content/renderer/web_ui_setup_impl.cc b/content/renderer/web_ui_setup_impl.cc |
index e4c065f8a807f30243e506ac18b89508d793064b..b9221a249cf346316660ef54116a4943743ce164 100644 |
--- a/content/renderer/web_ui_setup_impl.cc |
+++ b/content/renderer/web_ui_setup_impl.cc |
@@ -11,15 +11,10 @@ namespace content { |
// static |
void WebUISetupImpl::Bind(mojo::ScopedMessagePipeHandle handle) { |
- // This instance will be destroyed when the pipe is closed. See OnError. |
- new WebUISetupImpl(handle.Pass()); |
-} |
- |
-WebUISetupImpl::WebUISetupImpl(mojo::ScopedMessagePipeHandle handle) |
- : client_(ScopedWebUISetupClientHandle::From(handle.Pass()), this) { |
-} |
- |
-WebUISetupImpl::~WebUISetupImpl() { |
+ // This instance will be destroyed when the pipe is closed. |
+ WebUISetupPtr web_ui_setup(new WebUISetupImpl()); |
+ web_ui_setup.ConfigureStub(handle.Pass()); |
+ web_ui_setup.Detach(); |
} |
void WebUISetupImpl::SetWebUIHandle( |
@@ -34,8 +29,4 @@ void WebUISetupImpl::SetWebUIHandle( |
web_ui_mojo->SetBrowserHandle(web_ui_handle.Pass()); |
} |
-void WebUISetupImpl::OnError() { |
- delete this; |
-} |
- |
} // namespace content |