chrome_models / 19 /public /cpp /service_connection.cc
dejanseo's picture
Upload 29 files
f8dc3a0 verified
raw
history blame contribute delete
926 Bytes
// Copyright 2018 The Chromium 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 "chromeos/services/machine_learning/public/cpp/service_connection.h"
namespace chromeos {
namespace machine_learning {
namespace {
static ServiceConnection* g_fake_service_connection_for_testing = nullptr;
} // namespace
ServiceConnection* ServiceConnection::GetInstance() {
if (g_fake_service_connection_for_testing) {
return g_fake_service_connection_for_testing;
}
// The real impl lies in service_connection_ash.cc and
// service_connection_lacros.cc.
return CreateRealInstance();
}
void ServiceConnection::UseFakeServiceConnectionForTesting(
ServiceConnection* const fake_service_connection) {
g_fake_service_connection_for_testing = fake_service_connection;
}
} // namespace machine_learning
} // namespace chromeos