blob: 395e43d4658ad6a747b55620be7493bb943d4aa5 [file] [log] [blame]
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "tsp.h"
#include <base/lazy_instance.h>
namespace trunks {
// TSP singleton using the lazy instance initializer.
static base::LazyInstance<Tsp> tsp_instance = LAZY_INSTANCE_INITIALIZER;
Tsp* GetTspInstance() { return tsp_instance.Pointer(); }
ContextManager<TspContext>* Tsp::context_manager() {
if (context_manager_mock_ != NULL)
return context_manager_mock_;
return &context_manager_;
}
void Tsp::SetContextManagerTspMock(ContextManagerTspMock*
context_manager_mock) {
context_manager_mock_ = context_manager_mock;
}
} // namespace trunks