diff options
author | ricea <ricea@chromium.org> | 2014-09-16 19:12:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-17 02:13:05 +0000 |
commit | caf874447fabaaee90921d611a052648ea150c70 (patch) | |
tree | 79fed2cc7a795840140451f2d3a761edff784722 /base | |
parent | 0215564c6c0225e22419c85e7854c5ce103414c2 (diff) | |
download | chromium_src-caf874447fabaaee90921d611a052648ea150c70.zip chromium_src-caf874447fabaaee90921d611a052648ea150c70.tar.gz chromium_src-caf874447fabaaee90921d611a052648ea150c70.tar.bz2 |
Make base::internal::CallbackBase::is_null inline.
This saves 11 bytes per call site on x64-clang and 12 byte per call site on
ARM-gcc.
BUG=410776
TEST=base_unittests
Review URL: https://codereview.chromium.org/540883002
Cr-Commit-Position: refs/heads/master@{#295215}
Diffstat (limited to 'base')
-rw-r--r-- | base/callback_internal.cc | 4 | ||||
-rw-r--r-- | base/callback_internal.h | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/base/callback_internal.cc b/base/callback_internal.cc index 5acade0..ed0fb0d 100644 --- a/base/callback_internal.cc +++ b/base/callback_internal.cc @@ -9,10 +9,6 @@ namespace base { namespace internal { -bool CallbackBase::is_null() const { - return bind_state_.get() == NULL; -} - void CallbackBase::Reset() { polymorphic_invoke_ = NULL; // NULL the bind_state_ last, since it may be holding the last ref to whatever diff --git a/base/callback_internal.h b/base/callback_internal.h index e66623c..9d7761c4 100644 --- a/base/callback_internal.h +++ b/base/callback_internal.h @@ -37,7 +37,7 @@ class BindStateBase : public RefCountedThreadSafe<BindStateBase> { class BASE_EXPORT CallbackBase { public: // Returns true if Callback is null (doesn't refer to anything). - bool is_null() const; + bool is_null() const { return bind_state_.get() == NULL; } // Returns the Callback into an uninitialized state. void Reset(); |