This source file includes following definitions.
- weak_ptr_factory_
- Invalidate
- AsWeakPtr
- Stop
#include "jingle/notifier/base/weak_xmpp_client.h"
#include "base/compiler_specific.h"
namespace notifier {
WeakXmppClient::WeakXmppClient(talk_base::TaskParent* parent)
: buzz::XmppClient(parent),
weak_ptr_factory_(this) {}
WeakXmppClient::~WeakXmppClient() {
DCHECK(CalledOnValidThread());
Invalidate();
}
void WeakXmppClient::Invalidate() {
DCHECK(CalledOnValidThread());
SignalStateChange.disconnect_all();
SignalLogInput.disconnect_all();
SignalLogOutput.disconnect_all();
weak_ptr_factory_.InvalidateWeakPtrs();
}
base::WeakPtr<WeakXmppClient> WeakXmppClient::AsWeakPtr() {
DCHECK(CalledOnValidThread());
return weak_ptr_factory_.GetWeakPtr();
}
void WeakXmppClient::Stop() {
DCHECK(CalledOnValidThread());
Invalidate();
buzz::XmppClient::Stop();
}
}