Chromium Code Reviews| Index: content/renderer/media/android/stream_texture_wrapper_impl.cc |
| diff --git a/content/renderer/media/android/stream_texture_wrapper_impl.cc b/content/renderer/media/android/stream_texture_wrapper_impl.cc |
| index 67ecb156140c3a4038aceda5e4f2a1a200bd7b62..672b67394320bae184f364949f5f9402677a136c 100644 |
| --- a/content/renderer/media/android/stream_texture_wrapper_impl.cc |
| +++ b/content/renderer/media/android/stream_texture_wrapper_impl.cc |
| @@ -129,6 +129,10 @@ void StreamTextureWrapperImpl::UpdateTextureSize(const gfx::Size& new_size) { |
| return; |
| } |
| + // InitializeOnMainThread() hasn't completed, or failed. |
|
watk
2016/12/07 01:48:11
nit: "hasn't completed" makes it sounds like it ru
tguilbert
2016/12/07 19:23:55
Done.
|
| + if (!stream_texture_proxy_) |
| + return; |
| + |
| if (natural_size_ == new_size) |
| return; |
| @@ -142,7 +146,7 @@ void StreamTextureWrapperImpl::Initialize( |
| const base::Closure& received_frame_cb, |
| const gfx::Size& natural_size, |
| scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner, |
| - const base::Closure& init_cb) { |
| + const StreamTextureWrapperInitCB& init_cb) { |
| DVLOG(2) << __func__; |
| compositor_task_runner_ = compositor_task_runner; |
| @@ -156,24 +160,24 @@ void StreamTextureWrapperImpl::Initialize( |
| void StreamTextureWrapperImpl::InitializeOnMainThread( |
| const base::Closure& received_frame_cb, |
| - const base::Closure& init_cb) { |
| + const StreamTextureWrapperInitCB& init_cb) { |
| DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| DVLOG(2) << __func__; |
| stream_texture_proxy_ = factory_->CreateProxy( |
| kGLTextureExternalOES, &texture_id_, &texture_mailbox_); |
| - if (!stream_texture_proxy_) |
| + if (!stream_texture_proxy_) { |
| + init_cb.Run(false); |
| return; |
| + } |
| ReallocateVideoFrame(natural_size_); |
| stream_texture_proxy_->BindToTaskRunner(received_frame_cb, |
| compositor_task_runner_); |
| - // TODO(tguilbert): Register the surface properly. See crbug.com/627658. |
| - |
| // |init_cb| is bound to the thread that originally called Initialize(). |
|
watk
2016/12/07 01:48:11
nit: comment feels out of place now that you're ca
tguilbert
2016/12/07 19:23:55
Done.
|
| - init_cb.Run(); |
| + init_cb.Run(true); |
| } |
| void StreamTextureWrapperImpl::Destroy() { |