This source file includes following definitions.
- current
- SetToken
#include "chrome/service/cloud_print/cloud_print_token_store.h"
#include "base/lazy_instance.h"
#include "base/threading/thread_local.h"
namespace cloud_print {
static base::LazyInstance<base::ThreadLocalPointer<CloudPrintTokenStore> >
lazy_tls = LAZY_INSTANCE_INITIALIZER;
CloudPrintTokenStore* CloudPrintTokenStore::current() {
return lazy_tls.Pointer()->Get();
}
CloudPrintTokenStore::CloudPrintTokenStore() {
lazy_tls.Pointer()->Set(this);
}
CloudPrintTokenStore::~CloudPrintTokenStore() {
lazy_tls.Pointer()->Set(NULL);
}
void CloudPrintTokenStore::SetToken(const std::string& token) {
DCHECK(CalledOnValidThread());
token_ = token;
}
}