| 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..036612f2dfdfff316fcaff8bf7be6142c765ccee 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 run, or failed.
|
| + 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,23 @@ 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().
|
| - init_cb.Run();
|
| + init_cb.Run(true);
|
| }
|
|
|
| void StreamTextureWrapperImpl::Destroy() {
|
|
|