Commit 87adc130 authored by boliu@chromium.org's avatar boliu@chromium.org

Remove PostTask in StreamTextureProxyImpl

No longer need this PostTask hack since enabling ubercomp in
android webview. This essentially reverts r259875

BUG=344087

Review URL: https://codereview.chromium.org/344863005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278858 0039d316-1c4b-4281-b951-d872f2087c98
parent 633ff3b1
......@@ -39,7 +39,6 @@ class StreamTextureProxyImpl
virtual void Release() OVERRIDE;
private:
void BindOnCompositorThread(int stream_id);
void OnFrameAvailable();
scoped_refptr<base::MessageLoopProxy> loop_;
......@@ -60,8 +59,6 @@ class StreamTextureProxyImpl
StreamTextureProxyImpl::StreamTextureProxyImpl(
StreamTextureFactorySynchronousImpl::ContextProvider* provider)
: context_provider_(provider), has_updated_(false) {
DCHECK(RenderThreadImpl::current());
loop_ = RenderThreadImpl::current()->compositor_message_loop_proxy();
std::fill(current_matrix_, current_matrix_ + 16, 0);
}
......@@ -69,7 +66,7 @@ StreamTextureProxyImpl::~StreamTextureProxyImpl() {}
void StreamTextureProxyImpl::Release() {
SetClient(NULL);
if (!loop_->BelongsToCurrentThread())
if (loop_.get() && !loop_->BelongsToCurrentThread())
loop_->DeleteSoon(FROM_HERE, this);
else
delete this;
......@@ -81,19 +78,7 @@ void StreamTextureProxyImpl::SetClient(cc::VideoFrameProvider::Client* client) {
}
void StreamTextureProxyImpl::BindToCurrentThread(int stream_id) {
if (loop_->BelongsToCurrentThread()) {
BindOnCompositorThread(stream_id);
return;
}
// Weakptr is only used on compositor thread loop, so this is safe.
loop_->PostTask(FROM_HERE,
base::Bind(&StreamTextureProxyImpl::BindOnCompositorThread,
AsWeakPtr(),
stream_id));
}
void StreamTextureProxyImpl::BindOnCompositorThread(int stream_id) {
loop_ = base::MessageLoopProxy::current();
surface_texture_ = context_provider_->GetSurfaceTexture(stream_id);
if (!surface_texture_) {
LOG(ERROR) << "Failed to get SurfaceTexture for stream.";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment