diff options
author | mohan.reddy <mohan.reddy@samsung.com> | 2014-09-10 20:53:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-11 03:59:03 +0000 |
commit | 945f5aa3a9b0f3c4e43329d1ada1fb8b64b76d73 (patch) | |
tree | 592d2cb399f0c0c1dddaf2b752fecbcbb4091ca9 /chromeos/login | |
parent | a4eb244baaac411fe27fb2282e62a80ee20fe1ff (diff) | |
download | chromium_src-945f5aa3a9b0f3c4e43329d1ada1fb8b64b76d73.zip chromium_src-945f5aa3a9b0f3c4e43329d1ada1fb8b64b76d73.tar.gz chromium_src-945f5aa3a9b0f3c4e43329d1ada1fb8b64b76d73.tar.bz2 |
Changing the order of initialization WeakPtrFactory
Changing in the intialization order of WeakPtrFactory such that all
member variables should appear before the WeakPtrFactory to ensure
that any WeakPtrs to Controller are invalidated before its members
variable's destructors are executed, rendering them invalid.
BUG=303818
Review URL: https://codereview.chromium.org/552323003
Cr-Commit-Position: refs/heads/master@{#294319}
Diffstat (limited to 'chromeos/login')
-rw-r--r-- | chromeos/login/auth/online_attempt.cc | 4 | ||||
-rw-r--r-- | chromeos/login/auth/online_attempt.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/chromeos/login/auth/online_attempt.cc b/chromeos/login/auth/online_attempt.cc index fc728f6..6d950a4 100644 --- a/chromeos/login/auth/online_attempt.cc +++ b/chromeos/login/auth/online_attempt.cc @@ -34,8 +34,8 @@ OnlineAttempt::OnlineAttempt(AuthAttemptState* current_attempt, : message_loop_(base::MessageLoopProxy::current()), attempt_(current_attempt), resolver_(callback), - weak_factory_(this), - try_again_(true) { + try_again_(true), + weak_factory_(this) { DCHECK(attempt_->user_type == user_manager::USER_TYPE_REGULAR); } diff --git a/chromeos/login/auth/online_attempt.h b/chromeos/login/auth/online_attempt.h index c91d064..251fe0a 100644 --- a/chromeos/login/auth/online_attempt.h +++ b/chromeos/login/auth/online_attempt.h @@ -68,12 +68,12 @@ class CHROMEOS_EXPORT OnlineAttempt : public GaiaAuthConsumer { // Handles ClientLogin communications with Gaia. scoped_ptr<GaiaAuthFetcher> client_fetcher_; - // Used to cancel the CancelClientLogin closure. - base::WeakPtrFactory<OnlineAttempt> weak_factory_; - // Whether we're willing to re-try the ClientLogin attempt. bool try_again_; + // Used to cancel the CancelClientLogin closure. + base::WeakPtrFactory<OnlineAttempt> weak_factory_; + friend class OnlineAttemptTest; DISALLOW_COPY_AND_ASSIGN(OnlineAttempt); }; |