#include "net/device_bound_sessions/session_store.h"
#include <memory>
#include "base/files/file_path.h"
#include "components/unexportable_keys/unexportable_key_service.h"
#include "net/base/features.h"
#include "net/device_bound_sessions/session_store_impl.h"
#include "net/device_bound_sessions/unexportable_key_service_factory.h"
namespace net::device_bound_sessions {
std::unique_ptr<SessionStore> SessionStore::Create(
const base::FilePath& db_storage_path,
unexportable_keys::UnexportableKeyService* unexportable_key_service) {
unexportable_keys::UnexportableKeyService* key_service = nullptr;
if (unexportable_key_service) {
key_service = unexportable_key_service;
} else {
key_service = UnexportableKeyServiceFactory::GetInstance()->GetShared();
}
if (!key_service || db_storage_path.empty()) {
return nullptr;
}
return std::make_unique<SessionStoreImpl>(db_storage_path, *key_service);
}
}