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

Unified Diff: content/browser/renderer_host/begin_frame_observer_proxy.cc

Issue 1016033006: Enable BeginFrame scheduling on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable BeginFrame scheduling under flag Created 5 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: content/browser/renderer_host/begin_frame_observer_proxy.cc
diff --git a/content/browser/renderer_host/begin_frame_observer_proxy.cc b/content/browser/renderer_host/begin_frame_observer_proxy.cc
index 7a6651f53c3a9faf6d55e981e1838d333563dd5a..06baa18bd2a128390dd6436cf581077043c0f5fc 100644
--- a/content/browser/renderer_host/begin_frame_observer_proxy.cc
+++ b/content/browser/renderer_host/begin_frame_observer_proxy.cc
@@ -14,6 +14,7 @@ BeginFrameObserverProxy::BeginFrameObserverProxy(
}
BeginFrameObserverProxy::~BeginFrameObserverProxy() {
+ DCHECK(!compositor_);
}
void BeginFrameObserverProxy::SetNeedsBeginFrames(bool needs_begin_frames) {
@@ -38,6 +39,7 @@ void BeginFrameObserverProxy::SetCompositor(ui::Compositor* compositor) {
DCHECK(compositor);
compositor_ = compositor;
+ compositor_->AddObserver(this);
if (needs_begin_frames_)
StartObservingBeginFrames();
}
@@ -45,6 +47,7 @@ void BeginFrameObserverProxy::SetCompositor(ui::Compositor* compositor) {
void BeginFrameObserverProxy::ResetCompositor() {
if (!compositor_)
return;
+ compositor_->RemoveObserver(this);
if (needs_begin_frames_)
StopObservingBeginFrames();
@@ -57,6 +60,11 @@ void BeginFrameObserverProxy::OnSendBeginFrame(const cc::BeginFrameArgs& args) {
last_sent_begin_frame_args_ = args;
}
+void BeginFrameObserverProxy::OnCompositingShuttingDown(
+ ui::Compositor* compositor) {
+ ResetCompositor();
+}
+
void BeginFrameObserverProxy::StartObservingBeginFrames() {
DCHECK(compositor_);
compositor_->AddBeginFrameObserver(this);
« no previous file with comments | « content/browser/renderer_host/begin_frame_observer_proxy.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698