diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 23:29:31 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 23:29:31 +0000 |
commit | 59eff91b6b042f8389c4af756968a93407bf7c24 (patch) | |
tree | ccfcfb02ef774ffd178d948275dd8e4f07f30bf7 /base/callback_internal.cc | |
parent | c1640b0e400cca2f6d6d223703dcafe46a48a7af (diff) | |
download | chromium_src-59eff91b6b042f8389c4af756968a93407bf7c24.zip chromium_src-59eff91b6b042f8389c4af756968a93407bf7c24.tar.gz chromium_src-59eff91b6b042f8389c4af756968a93407bf7c24.tar.bz2 |
Callback: De-inline CallbackBase, and move to callback_helpers -> callback_internal.h
We can re-inline later if it starts being an issue.
BUG=none
TEST=unit-tests
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75443
Review URL: http://codereview.chromium.org/6542026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/callback_internal.cc')
-rw-r--r-- | base/callback_internal.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/base/callback_internal.cc b/base/callback_internal.cc new file mode 100644 index 0000000..d9d1e6f --- /dev/null +++ b/base/callback_internal.cc @@ -0,0 +1,36 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/callback_internal.h" + +namespace base { +namespace internal { + +bool CallbackBase::is_null() const { + return invoker_storage_.get() == NULL; +} + +void CallbackBase::Reset() { + invoker_storage_ = NULL; + polymorphic_invoke_ = NULL; +} + +bool CallbackBase::Equals(const CallbackBase& other) const { + return invoker_storage_.get() == other.invoker_storage_.get() && + polymorphic_invoke_ == other.polymorphic_invoke_; +} + +CallbackBase::CallbackBase(InvokeFuncStorage polymorphic_invoke, + scoped_refptr<InvokerStorageBase>* invoker_storage) + : polymorphic_invoke_(polymorphic_invoke) { + if (invoker_storage) { + invoker_storage_.swap(*invoker_storage); + } +} + +CallbackBase::~CallbackBase() { +} + +} // namespace base +} // namespace internal |