Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #include "base/callback_internal.h" |
michael@0 | 6 | |
michael@0 | 7 | #include "base/logging.h" |
michael@0 | 8 | |
michael@0 | 9 | namespace base { |
michael@0 | 10 | namespace internal { |
michael@0 | 11 | |
michael@0 | 12 | bool CallbackBase::is_null() const { |
michael@0 | 13 | return bind_state_.get() == NULL; |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | void CallbackBase::Reset() { |
michael@0 | 17 | polymorphic_invoke_ = NULL; |
michael@0 | 18 | // NULL the bind_state_ last, since it may be holding the last ref to whatever |
michael@0 | 19 | // object owns us, and we may be deleted after that. |
michael@0 | 20 | bind_state_ = NULL; |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | bool CallbackBase::Equals(const CallbackBase& other) const { |
michael@0 | 24 | return bind_state_.get() == other.bind_state_.get() && |
michael@0 | 25 | polymorphic_invoke_ == other.polymorphic_invoke_; |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | CallbackBase::CallbackBase(BindStateBase* bind_state) |
michael@0 | 29 | : bind_state_(bind_state), |
michael@0 | 30 | polymorphic_invoke_(NULL) { |
michael@0 | 31 | DCHECK(!bind_state_.get() || bind_state_->HasOneRef()); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | CallbackBase::~CallbackBase() { |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | } // namespace internal |
michael@0 | 38 | } // namespace base |