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

Unified Diff: components/native_viewport/native_viewport_impl.cc

Issue 1139673003: Make Mandoline shut down cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash in surfaces if surfaceimpl outlives the app, and a double delete in browser Created 5 years, 7 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
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() {

Powered by Google App Engine
This is Rietveld 408576698