diff options
author | dmichael <dmichael@chromium.org> | 2015-01-13 17:38:08 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-14 01:38:51 +0000 |
commit | 57c885a05f8d948f0a8c6b34b2ed7d6b3cd09b58 (patch) | |
tree | e85c4ef86a538142827f8074da9d7d354372bcfc /base/cancelable_callback.h | |
parent | 3e05f41653bf36cce40718d8295ce2293218dab6 (diff) | |
download | chromium_src-57c885a05f8d948f0a8c6b34b2ed7d6b3cd09b58.zip chromium_src-57c885a05f8d948f0a8c6b34b2ed7d6b3cd09b58.tar.gz chromium_src-57c885a05f8d948f0a8c6b34b2ed7d6b3cd09b58.tar.bz2 |
Make CancelableCallback::weak_factory_ the last member.
BUG=303818,433583
Review URL: https://codereview.chromium.org/846543002
Cr-Commit-Position: refs/heads/master@{#311389}
Diffstat (limited to 'base/cancelable_callback.h')
-rw-r--r-- | base/cancelable_callback.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/base/cancelable_callback.h b/base/cancelable_callback.h index 91eb046..2b9d260 100644 --- a/base/cancelable_callback.h +++ b/base/cancelable_callback.h @@ -62,8 +62,7 @@ class CancelableCallback<void(A...)> { // |callback| must not be null. explicit CancelableCallback(const base::Callback<void(A...)>& callback) - : weak_factory_(this), - callback_(callback) { + : callback_(callback), weak_factory_(this) { DCHECK(!callback.is_null()); InitializeForwarder(); } @@ -113,17 +112,15 @@ class CancelableCallback<void(A...)> { weak_factory_.GetWeakPtr()); } - // Used to ensure Forward() is not run when this object is destroyed. - // TODO(ckehoe): This should be the last class member. - // Move it there when crbug.com/433583 is fixed. - base::WeakPtrFactory<CancelableCallback<void(A...)> > weak_factory_; - // The wrapper closure. base::Callback<void(A...)> forwarder_; // The stored closure that may be cancelled. base::Callback<void(A...)> callback_; + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory<CancelableCallback<void(A...)>> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); }; |