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

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

Issue 152983004: Fix RenderWidgetHostViewAura as observer of CompositorVSyncManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: b7832f28 Initial. Created 6 years, 10 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 1c66023493c04e0418f29626a53b62edddb9e923..1a7c094dd1c8cceb3abb6010ea9f78b0ded69408 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -67,6 +67,7 @@
#include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ui_base_types.h"
+#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/compositor/layer.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
@@ -3320,6 +3321,9 @@ RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
if (touch_editing_client_)
touch_editing_client_->OnViewDestroyed();
+ if (vsync_manager_)
+ vsync_manager_->RemoveObserver(this);
+
ImageTransportFactory::GetInstance()->RemoveObserver(this);
window_observer_.reset();
@@ -3531,8 +3535,10 @@ void RenderWidgetHostViewAura::AddedToRootWindow() {
#endif
ui::Compositor* compositor = GetCompositor();
- if (compositor)
- compositor->vsync_manager()->AddObserver(this);
+ if (compositor) {
piman 2014/02/13 01:44:36 You need to deregister yourself from vsync_manager
+ vsync_manager_ = compositor->vsync_manager();
+ vsync_manager_->AddObserver(this);
+ }
}
void RenderWidgetHostViewAura::RemovingFromRootWindow() {
@@ -3557,11 +3563,8 @@ void RenderWidgetHostViewAura::RemovingFromRootWindow() {
resize_lock_.reset();
host_->WasResized();
- if (compositor) {
- if (compositor->HasObserver(this))
- compositor->RemoveObserver(this);
- compositor->vsync_manager()->RemoveObserver(this);
- }
+ if (compositor && compositor->HasObserver(this))
+ compositor->RemoveObserver(this);
#if defined(OS_WIN)
// Update the legacy window's parent temporarily to the desktop window. It
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698