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

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

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 80e0b1c9f6f88f67fbd3faf7fd1a137e09865b91..2d6a168500a728209d0ea53d940f4c2667303567 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -46,6 +46,10 @@ CommandBufferProxyImpl::~CommandBufferProxyImpl() {
delete it->second.shared_memory;
it->second.shared_memory = NULL;
}
+ for (Decoders::iterator it = video_decoder_hosts_.begin();
+ it != video_decoder_hosts_.end(); ++it) {
+ it->second->Destroy();
+ }
}
bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) {
@@ -483,7 +487,7 @@ void CommandBufferProxyImpl::SetNotifyRepaintTask(const base::Closure& task) {
notify_repaint_task_ = task;
}
-scoped_refptr<GpuVideoDecodeAcceleratorHost>
+GpuVideoDecodeAcceleratorHost*
CommandBufferProxyImpl::CreateVideoDecoder(
media::VideoCodecProfile profile,
media::VideoDecodeAccelerator::Client* client) {
@@ -499,13 +503,13 @@ CommandBufferProxyImpl::CreateVideoDecoder(
return NULL;
}
- scoped_refptr<GpuVideoDecodeAcceleratorHost> decoder_host =
+ 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;
DCHECK(inserted);
- channel_->AddRoute(decoder_route_id, decoder_host->AsWeakPtr());
+ channel_->AddRoute(decoder_route_id, base::AsWeakPtr(decoder_host));
return decoder_host;
}
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/gpu_video_decode_accelerator_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698