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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 10852009: Clarify ownership of GpuVideoDecodeAcceleratorHost and avoid crash on context loss. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index 2d6a168500a728209d0ea53d940f4c2667303567..d6387747ab17b175341db4dc2a7c6c0be91a19e4 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -48,7 +48,8 @@ CommandBufferProxyImpl::~CommandBufferProxyImpl() {
}
for (Decoders::iterator it = video_decoder_hosts_.begin();
it != video_decoder_hosts_.end(); ++it) {
- it->second->Destroy();
+ if (it->second)
+ it->second->OnChannelError();
}
}
@@ -506,7 +507,7 @@ CommandBufferProxyImpl::CreateVideoDecoder(
GpuVideoDecodeAcceleratorHost* decoder_host =
new GpuVideoDecodeAcceleratorHost(channel_, decoder_route_id, client);
bool inserted = video_decoder_hosts_.insert(std::make_pair(
- decoder_route_id, decoder_host)).second;
+ decoder_route_id, base::AsWeakPtr(decoder_host))).second;
DCHECK(inserted);
channel_->AddRoute(decoder_route_id, base::AsWeakPtr(decoder_host));

Powered by Google App Engine
This is Rietveld 408576698