Chromium Code Reviews| Index: content/renderer/media/android/stream_texture_factory.cc |
| diff --git a/content/renderer/media/android/stream_texture_factory.cc b/content/renderer/media/android/stream_texture_factory.cc |
| index 2408fa1910bf94b8334850a9744e9a13b13b7994..f9c02492d371d2738ce39a32c3128a3dce294bbb 100644 |
| --- a/content/renderer/media/android/stream_texture_factory.cc |
| +++ b/content/renderer/media/android/stream_texture_factory.cc |
| @@ -15,8 +15,7 @@ |
| namespace content { |
| -StreamTextureProxy::StreamTextureProxy(StreamTextureHost* host) |
| - : host_(host), client_(NULL) {} |
| +StreamTextureProxy::StreamTextureProxy(StreamTextureHost* host) : host_(host) {} |
| StreamTextureProxy::~StreamTextureProxy() {} |
| @@ -25,7 +24,7 @@ void StreamTextureProxy::Release() { |
| // Cannot call into |client_| anymore (from any thread) after returning |
|
watk
2016/07/29 19:03:16
|client_| is dead
tguilbert
2016/08/01 22:05:57
Done.
|
| // from here. |
| base::AutoLock lock(lock_); |
| - client_ = NULL; |
| + received_frame_cb_.Reset(); |
| } |
| // Release is analogous to the destructor, so there should be no more external |
| // calls to this object in Release. Therefore there is no need to acquire the |
| @@ -38,7 +37,7 @@ void StreamTextureProxy::Release() { |
| void StreamTextureProxy::BindToLoop( |
| int32_t stream_id, |
| - cc::VideoFrameProvider::Client* client, |
| + const base::Closure& received_frame_cb, |
| scoped_refptr<base::SingleThreadTaskRunner> loop) { |
| DCHECK(loop.get()); |
| @@ -46,7 +45,7 @@ void StreamTextureProxy::BindToLoop( |
| base::AutoLock lock(lock_); |
| DCHECK(!loop_.get() || (loop.get() == loop_.get())); |
| loop_ = loop; |
| - client_ = client; |
| + received_frame_cb_ = received_frame_cb; |
| } |
| if (loop->BelongsToCurrentThread()) { |
| @@ -67,8 +66,8 @@ void StreamTextureProxy::BindOnThread(int32_t stream_id) { |
| void StreamTextureProxy::OnFrameAvailable() { |
| base::AutoLock lock(lock_); |
| - if (client_) |
| - client_->DidReceiveFrame(); |
| + if (!received_frame_cb_.is_null()) |
| + received_frame_cb_.Run(); |
| } |
| // static |