#include "common/audit/logger.h"
#include "service/type-converter.h"
#include "service/engine-error-converter.h"
+#include "service/core-usage.h"
#include "ui/askuser.h"
#include "csr/error.h"
namespace Csr {
+namespace {
+
+void setCoreUsage(const csr_cs_core_usage_e &cu)
+{
+ switch (cu) {
+ case CSR_CS_USE_CORE_HALF:
+ case CSR_CS_USE_CORE_SINGLE:
+ CpuUsageManager::set(cu);
+ break;
+
+ default:
+ break;
+ }
+}
+
+} // namespace anonymous
+
CsLogic::CsLogic() :
m_loader(new CsLoader(CS_ENGINE_PATH)),
m_db(new Db::Manager(RW_DBSPACE "/.csr.db", RO_DBSPACE))
{
EXCEPTION_GUARD_START
+ setCoreUsage(context.coreUsage);
+
CsEngineContext engineContext(*m_loader);
auto &c = engineContext.get();
{
EXCEPTION_GUARD_START
+ setCoreUsage(context.coreUsage);
+
if (File::isInApp(filepath))
return scanApp(context, filepath);
#include "common/em-result.h"
#include "service/exception.h"
#include "service/access-control.h"
+#include "service/core-usage.h"
#include "csr/content-screening-types.h"
m_workqueue.submit(std::bind([this, &connection, process](RawBuffer &buffer) {
connection->send((*process)(connection, buffer));
+ CpuUsageManager::reset();
}, connection->receive()));
}