blob: 582fbdc12c43b520f81e5684c3dde02072e476ea [file] [log] [blame]
[email protected]59eff912011-02-18 23:29:311// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "base/callback_internal.h"
6
7namespace base {
8namespace internal {
9
10bool CallbackBase::is_null() const {
[email protected]7296f2762011-11-21 19:23:4411 return bind_state_.get() == NULL;
[email protected]59eff912011-02-18 23:29:3112}
13
14void CallbackBase::Reset() {
[email protected]7296f2762011-11-21 19:23:4415 bind_state_ = NULL;
[email protected]59eff912011-02-18 23:29:3116 polymorphic_invoke_ = NULL;
17}
18
19bool CallbackBase::Equals(const CallbackBase& other) const {
[email protected]7296f2762011-11-21 19:23:4420 return bind_state_.get() == other.bind_state_.get() &&
[email protected]59eff912011-02-18 23:29:3121 polymorphic_invoke_ == other.polymorphic_invoke_;
22}
23
24CallbackBase::CallbackBase(InvokeFuncStorage polymorphic_invoke,
[email protected]7296f2762011-11-21 19:23:4425 scoped_refptr<BindStateBase>* bind_state)
[email protected]59eff912011-02-18 23:29:3126 : polymorphic_invoke_(polymorphic_invoke) {
[email protected]7296f2762011-11-21 19:23:4427 if (bind_state) {
28 bind_state_.swap(*bind_state);
[email protected]59eff912011-02-18 23:29:3129 }
30}
31
32CallbackBase::~CallbackBase() {
33}
34
35} // namespace base
36} // namespace internal