Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4159)

Unified Diff: android_webview/browser/render_thread_manager.cc

Issue 1943963003: WIP Handle AwContents needing multiple live functors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PS7 comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/render_thread_manager.cc
diff --git a/android_webview/browser/render_thread_manager.cc b/android_webview/browser/render_thread_manager.cc
index c2c9c6e0eecc061fed1b4402ff9eb6b765abe6b9..47cdddb08dc3cdfa3b4fdd99da9d551b7285ac9a 100644
--- a/android_webview/browser/render_thread_manager.cc
+++ b/android_webview/browser/render_thread_manager.cc
@@ -106,7 +106,7 @@ RenderThreadManager::RenderThreadManager(
RenderThreadManager::~RenderThreadManager() {
DCHECK(ui_loop_->BelongsToCurrentThread());
if (compositor_frame_producer_) {
- compositor_frame_producer_->OnCompositorFrameConsumerWillDestroy();
+ compositor_frame_producer_->RemoveCompositorFrameConsumer(this);
}
DCHECK(!hardware_renderer_.get());
}
@@ -158,7 +158,7 @@ void RenderThreadManager::ClientRequestInvokeGLOnUI() {
void RenderThreadManager::UpdateParentDrawConstraintsOnUI() {
DCHECK(ui_loop_->BelongsToCurrentThread());
if (compositor_frame_producer_) {
- compositor_frame_producer_->OnParentDrawConstraintsUpdated();
+ compositor_frame_producer_->OnParentDrawConstraintsUpdated(this);
}
}
@@ -362,6 +362,11 @@ void RenderThreadManager::DeleteHardwareRendererOnUI() {
void RenderThreadManager::SetCompositorFrameProducer(
CompositorFrameProducer* compositor_frame_producer) {
+ if (compositor_frame_producer == compositor_frame_producer_) {
boliu 2016/05/05 21:40:32 instead of the early out, relax the DCHECK instead
Tobias Sargeant 2016/05/06 12:41:09 Done.
+ return;
+ }
+ DCHECK_NE(compositor_frame_producer_ == nullptr,
+ compositor_frame_producer == nullptr);
compositor_frame_producer_ = compositor_frame_producer;
}

Powered by Google App Engine
This is Rietveld 408576698