[email protected] | 59eff91 | 2011-02-18 23:29:31 | [diff] [blame] | 1 | // 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 | |||||
7 | namespace base { | ||||
8 | namespace internal { | ||||
9 | |||||
10 | bool CallbackBase::is_null() const { | ||||
[email protected] | 7296f276 | 2011-11-21 19:23:44 | [diff] [blame] | 11 | return bind_state_.get() == NULL; |
[email protected] | 59eff91 | 2011-02-18 23:29:31 | [diff] [blame] | 12 | } |
13 | |||||
14 | void CallbackBase::Reset() { | ||||
[email protected] | 7296f276 | 2011-11-21 19:23:44 | [diff] [blame] | 15 | bind_state_ = NULL; |
[email protected] | 59eff91 | 2011-02-18 23:29:31 | [diff] [blame] | 16 | polymorphic_invoke_ = NULL; |
17 | } | ||||
18 | |||||
19 | bool CallbackBase::Equals(const CallbackBase& other) const { | ||||
[email protected] | 7296f276 | 2011-11-21 19:23:44 | [diff] [blame] | 20 | return bind_state_.get() == other.bind_state_.get() && |
[email protected] | 59eff91 | 2011-02-18 23:29:31 | [diff] [blame] | 21 | polymorphic_invoke_ == other.polymorphic_invoke_; |
22 | } | ||||
23 | |||||
24 | CallbackBase::CallbackBase(InvokeFuncStorage polymorphic_invoke, | ||||
[email protected] | 7296f276 | 2011-11-21 19:23:44 | [diff] [blame] | 25 | scoped_refptr<BindStateBase>* bind_state) |
[email protected] | 59eff91 | 2011-02-18 23:29:31 | [diff] [blame] | 26 | : polymorphic_invoke_(polymorphic_invoke) { |
[email protected] | 7296f276 | 2011-11-21 19:23:44 | [diff] [blame] | 27 | if (bind_state) { |
28 | bind_state_.swap(*bind_state); | ||||
[email protected] | 59eff91 | 2011-02-18 23:29:31 | [diff] [blame] | 29 | } |
30 | } | ||||
31 | |||||
32 | CallbackBase::~CallbackBase() { | ||||
33 | } | ||||
34 | |||||
35 | } // namespace base | ||||
36 | } // namespace internal |