Index: components/native_viewport/native_viewport_impl.cc |
diff --git a/components/native_viewport/native_viewport_impl.cc b/components/native_viewport/native_viewport_impl.cc |
index 2f85500088553deddbbbaca9b657e83e1ddf9dfe..9644d5cab10fcf9190bda14e243c5f7c6b47237d 100644 |
--- a/components/native_viewport/native_viewport_impl.cc |
+++ b/components/native_viewport/native_viewport_impl.cc |
@@ -20,8 +20,10 @@ namespace native_viewport { |
NativeViewportImpl::NativeViewportImpl( |
bool is_headless, |
const scoped_refptr<gles2::GpuState>& gpu_state, |
- mojo::InterfaceRequest<mojo::NativeViewport> request) |
+ mojo::InterfaceRequest<mojo::NativeViewport> request, |
+ scoped_ptr<mojo::ServiceRefcount> service_refcount) |
: is_headless_(is_headless), |
+ service_refcount_(service_refcount.Pass()), |
context_provider_(gpu_state), |
sent_metrics_(false), |
metrics_(mojo::ViewportMetrics::New()), |
@@ -150,8 +152,7 @@ bool NativeViewportImpl::OnEvent(mojo::EventPtr event) { |
} |
void NativeViewportImpl::OnDestroyed() { |
- // This will signal a connection error and cause us to delete |this|. |
- binding_.Close(); |
+ delete this; |
} |
void NativeViewportImpl::OnConnectionError() { |