Commit ddca3634 authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

Simplify AwContents::SetAwGLFunctor()

Right now, AwContents has a member |functor_|. This is never read. It is
only written in the function it is being consumed in.

This CL simplifies AwContents by removing the |functor_| member and
consuming the parameter in SetAwGLFunctor().

Change-Id: Ib40ee7d7e198b656e2f8b9011996b6d0550596bf
Reviewed-on: https://chromium-review.googlesource.com/c/1352414Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611458}
parent 6a753e66
......@@ -235,7 +235,6 @@ AwRenderProcessGoneDelegate* AwRenderProcessGoneDelegate::FromWebContents(
AwContents::AwContents(std::unique_ptr<WebContents> web_contents)
: content::WebContentsObserver(web_contents.get()),
functor_(nullptr),
browser_view_renderer_(
this,
base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::UI})),
......@@ -395,16 +394,8 @@ base::android::ScopedJavaLocalRef<jobject> AwContents::GetWebContents(
}
void AwContents::SetAwGLFunctor(AwGLFunctor* functor) {
if (functor == functor_) {
return;
}
functor_ = functor;
if (functor_) {
browser_view_renderer_.SetCurrentCompositorFrameConsumer(
functor_->GetCompositorFrameConsumer());
} else {
browser_view_renderer_.SetCurrentCompositorFrameConsumer(nullptr);
}
browser_view_renderer_.SetCurrentCompositorFrameConsumer(
functor ? functor->GetCompositorFrameConsumer() : nullptr);
}
void AwContents::SetAwGLFunctor(JNIEnv* env,
......
......@@ -374,7 +374,6 @@ class AwContents : public FindHelper::Listener,
void SetAwGLFunctor(AwGLFunctor* functor);
JavaObjectWeakGlobalRef java_ref_;
AwGLFunctor* functor_;
BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|.
std::unique_ptr<content::WebContents> web_contents_;
std::unique_ptr<AwWebContentsDelegate> web_contents_delegate_;
......
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