summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/gpu_video_decoder_host.cc16
-rw-r--r--chrome/renderer/gpu_video_decoder_host.h2
-rw-r--r--chrome/renderer/gpu_video_service_host.cc9
-rw-r--r--chrome/renderer/gpu_video_service_host.h2
4 files changed, 16 insertions, 13 deletions
diff --git a/chrome/renderer/gpu_video_decoder_host.cc b/chrome/renderer/gpu_video_decoder_host.cc
index 16b818a..a1a7962 100644
--- a/chrome/renderer/gpu_video_decoder_host.cc
+++ b/chrome/renderer/gpu_video_decoder_host.cc
@@ -24,7 +24,7 @@ GpuVideoDecoderHost::GpuVideoDecoderHost(GpuVideoServiceHost* service_host,
}
void GpuVideoDecoderHost::OnChannelError() {
- channel_host_.release();
+ channel_host_ = NULL;
}
void GpuVideoDecoderHost::OnMessageReceived(const IPC::Message& msg) {
@@ -49,7 +49,7 @@ bool GpuVideoDecoderHost::Initialize(const GpuVideoDecoderInitParam& param) {
DCHECK_EQ(state_, kStateUninitialized);
init_param_ = param;
- if (!channel_host_->Send(
+ if (!channel_host_ || !channel_host_->Send(
new GpuVideoDecoderMsg_Initialize(route_id(), param))) {
LOG(ERROR) << "GpuVideoDecoderMsg_Initialize failed";
return false;
@@ -58,7 +58,8 @@ bool GpuVideoDecoderHost::Initialize(const GpuVideoDecoderInitParam& param) {
}
bool GpuVideoDecoderHost::Uninitialize() {
- if (!channel_host_->Send(new GpuVideoDecoderMsg_Destroy(route_id()))) {
+ if (!channel_host_ || !channel_host_->Send(
+ new GpuVideoDecoderMsg_Destroy(route_id()))) {
LOG(ERROR) << "GpuVideoDecoderMsg_Destroy failed";
return false;
}
@@ -87,7 +88,7 @@ void GpuVideoDecoderHost::FillThisBuffer(scoped_refptr<VideoFrame> frame) {
return;
GpuVideoDecoderOutputBufferParam param;
- if (!channel_host_->Send(
+ if (!channel_host_ || !channel_host_->Send(
new GpuVideoDecoderMsg_FillThisBuffer(route_id(), param))) {
LOG(ERROR) << "GpuVideoDecoderMsg_FillThisBuffer failed";
}
@@ -95,7 +96,8 @@ void GpuVideoDecoderHost::FillThisBuffer(scoped_refptr<VideoFrame> frame) {
bool GpuVideoDecoderHost::Flush() {
state_ = kStateFlushing;
- if (!channel_host_->Send(new GpuVideoDecoderMsg_Flush(route_id()))) {
+ if (!channel_host_ || !channel_host_->Send(
+ new GpuVideoDecoderMsg_Flush(route_id()))) {
LOG(ERROR) << "GpuVideoDecoderMsg_Flush failed";
return false;
}
@@ -179,7 +181,7 @@ void GpuVideoDecoderHost::OnFillThisBufferDone(
}
event_handler_->OnFillBufferDone(frame);
- if (!channel_host_->Send(
+ if (!channel_host_ || !channel_host_->Send(
new GpuVideoDecoderMsg_FillThisBufferDoneACK(route_id()))) {
LOG(ERROR) << "GpuVideoDecoderMsg_FillThisBufferDoneACK failed";
}
@@ -206,7 +208,7 @@ void GpuVideoDecoderHost::SendInputBufferToGpu() {
param.size_ = buffer->GetDataSize();
param.timestamp_ = buffer->GetTimestamp().InMicroseconds();
memcpy(input_transfer_buffer_->memory(), buffer->GetData(), param.size_);
- if (!channel_host_->Send(
+ if (!channel_host_ || !channel_host_->Send(
new GpuVideoDecoderMsg_EmptyThisBuffer(route_id(), param))) {
LOG(ERROR) << "GpuVideoDecoderMsg_EmptyThisBuffer failed";
}
diff --git a/chrome/renderer/gpu_video_decoder_host.h b/chrome/renderer/gpu_video_decoder_host.h
index dccafff..af88561 100644
--- a/chrome/renderer/gpu_video_decoder_host.h
+++ b/chrome/renderer/gpu_video_decoder_host.h
@@ -81,7 +81,7 @@ class GpuVideoDecoderHost
// We expect that GpuVideoServiceHost's always available during our life span.
GpuVideoServiceHost* gpu_video_service_host_;
- scoped_refptr<GpuChannelHost> channel_host_;
+ GpuChannelHost* channel_host_;
// We expect that the client of us will always available during our life span.
EventHandler* event_handler_;
diff --git a/chrome/renderer/gpu_video_service_host.cc b/chrome/renderer/gpu_video_service_host.cc
index 61a2dcd..c80e35d 100644
--- a/chrome/renderer/gpu_video_service_host.cc
+++ b/chrome/renderer/gpu_video_service_host.cc
@@ -9,14 +9,15 @@
#include "chrome/renderer/render_thread.h"
GpuVideoServiceHost::GpuVideoServiceHost()
- : router_(NULL),
+ : channel_host_(NULL),
+ router_(NULL),
message_loop_(NULL) {
memset(&service_info_, 0, sizeof(service_info_));
}
void GpuVideoServiceHost::OnChannelError() {
LOG(ERROR) << "GpuVideoServiceHost::OnChannelError";
- channel_host_.release();
+ channel_host_ = NULL;
router_ = NULL;
}
@@ -32,7 +33,7 @@ scoped_refptr<GpuVideoDecoderHost> GpuVideoServiceHost::CreateVideoDecoder(
GpuVideoDecoderHost::EventHandler* event_handler) {
DCHECK(RenderThread::current());
- if (!channel_host_.get() || !service_info_.service_available_)
+ if (!channel_host_ || !service_info_.service_available_)
return NULL;
GpuVideoDecoderInfoParam param;
@@ -60,7 +61,7 @@ void GpuVideoServiceHost::DestroyVideoDecoder(
scoped_refptr<GpuVideoDecoderHost> gpu_video_decoder_host) {
DCHECK(RenderThread::current());
- if (!channel_host_.get() || !service_info_.service_available_)
+ if (!channel_host_ || !service_info_.service_available_)
return;
DCHECK(gpu_video_decoder_host.get());
diff --git a/chrome/renderer/gpu_video_service_host.h b/chrome/renderer/gpu_video_service_host.h
index 1d458e9..d3ca06f 100644
--- a/chrome/renderer/gpu_video_service_host.h
+++ b/chrome/renderer/gpu_video_service_host.h
@@ -34,7 +34,7 @@ class GpuVideoServiceHost : public IPC::Channel::Listener,
private:
GpuVideoServiceHost();
- scoped_refptr<GpuChannelHost> channel_host_;
+ GpuChannelHost* channel_host_;
MessageRouter* router_;
GpuVideoServiceInfoParam service_info_;
MessageLoop* message_loop_; // Message loop of render thread.