summaryrefslogtreecommitdiff
path: root/chromium/ui/aura/window_tree_host_platform.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/aura/window_tree_host_platform.cc')
-rw-r--r--chromium/ui/aura/window_tree_host_platform.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chromium/ui/aura/window_tree_host_platform.cc b/chromium/ui/aura/window_tree_host_platform.cc
index ae7a71ac0c4..039befdfd81 100644
--- a/chromium/ui/aura/window_tree_host_platform.cc
+++ b/chromium/ui/aura/window_tree_host_platform.cc
@@ -192,9 +192,14 @@ void WindowTreeHostPlatform::OnBoundsChanged(const gfx::Rect& new_bounds) {
float current_scale = compositor()->device_scale_factor();
float new_scale = ui::GetScaleFactorForNativeView(window());
gfx::Rect old_bounds = bounds_;
+ auto weak_ref = GetWeakPtr();
bounds_ = new_bounds;
- if (bounds_.origin() != old_bounds.origin())
+ if (bounds_.origin() != old_bounds.origin()) {
OnHostMovedInPixels(bounds_.origin());
+ // Changing the bounds may destroy this.
+ if (!weak_ref)
+ return;
+ }
if (pending_local_surface_id_.is_valid() ||
bounds_.size() != old_bounds.size() || current_scale != new_scale) {
auto local_surface_id = bounds_.size() == pending_size_