From 8669d48933731f224474a9b1dc55824f87ae26a7 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 Jul 2024 14:53:18 +0200 Subject: Use LocalContext in execution and serve services The context is passed by not_null const pointer in order to avoid binding to temporaries, and it or parts of it get stored by const ref where needed. --- .../execution_api/execution_service/execution_server.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/execution_server.hpp') diff --git a/src/buildtool/execution_api/execution_service/execution_server.hpp b/src/buildtool/execution_api/execution_service/execution_server.hpp index 7107ed45..e09f028b 100644 --- a/src/buildtool/execution_api/execution_service/execution_server.hpp +++ b/src/buildtool/execution_api/execution_service/execution_server.hpp @@ -25,6 +25,7 @@ #include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/execution_api/execution_service/operation_cache.hpp" +#include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" @@ -32,12 +33,11 @@ class ExecutionServiceImpl final : public bazel_re::Execution::Service { public: explicit ExecutionServiceImpl( - gsl::not_null const& storage_config, - gsl::not_null const& storage, + gsl::not_null const& local_context, gsl::not_null const& local_api, std::optional op_exponent) noexcept - : storage_config_{*storage_config}, - storage_{*storage}, + : storage_config_{*local_context->storage_config}, + storage_{*local_context->storage}, api_{*local_api} { if (op_exponent) { op_cache_.SetExponent(*op_exponent); -- cgit v1.2.3