Commit 51b7efeb authored by dmichael's avatar dmichael Committed by Commit bot

Fix WeakPtrFactory member in LoginDisplayHostImpl

This forces WeakPtrs to be invalidated before other members' destructors run.
See the bug or the documentation of WeakPtrFactory for more information. I'm
in the process of trying to turn on a clang check for this (see the bug).

BUG=303818
R=stevenjb@chromium.org

Review URL: https://codereview.chromium.org/841103003

Cr-Commit-Position: refs/heads/master@{#311373}
parent 7f7a13dd
...@@ -272,7 +272,6 @@ const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; ...@@ -272,7 +272,6 @@ const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111;
LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds)
: background_bounds_(background_bounds), : background_bounds_(background_bounds),
pointer_factory_(this),
shutting_down_(false), shutting_down_(false),
oobe_progress_bar_visible_(false), oobe_progress_bar_visible_(false),
session_starting_(false), session_starting_(false),
...@@ -288,6 +287,7 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) ...@@ -288,6 +287,7 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds)
startup_sound_played_(false), startup_sound_played_(false),
startup_sound_honors_spoken_feedback_(false), startup_sound_honors_spoken_feedback_(false),
is_observing_keyboard_(false), is_observing_keyboard_(false),
pointer_factory_(this),
animation_weak_ptr_factory_(this) { animation_weak_ptr_factory_(this) {
DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this);
CrasAudioHandler::Get()->AddAudioObserver(this); CrasAudioHandler::Get()->AddAudioObserver(this);
......
...@@ -209,8 +209,6 @@ class LoginDisplayHostImpl : public LoginDisplayHost, ...@@ -209,8 +209,6 @@ class LoginDisplayHostImpl : public LoginDisplayHost,
content::NotificationRegistrar registrar_; content::NotificationRegistrar registrar_;
base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_;
// Default LoginDisplayHost. // Default LoginDisplayHost.
static LoginDisplayHost* default_host_; static LoginDisplayHost* default_host_;
...@@ -325,6 +323,7 @@ class LoginDisplayHostImpl : public LoginDisplayHost, ...@@ -325,6 +323,7 @@ class LoginDisplayHostImpl : public LoginDisplayHost,
scoped_ptr<aura::Window> login_screen_container_; scoped_ptr<aura::Window> login_screen_container_;
#endif #endif
base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_;
base::WeakPtrFactory<LoginDisplayHostImpl> animation_weak_ptr_factory_; base::WeakPtrFactory<LoginDisplayHostImpl> animation_weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl); DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl);
......
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