mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
569c7d84b0
PiperOrigin-RevId: 335017461 Change-Id: I583444057bb4d8c8c33694fbba4d3717bb22101a
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
// Copyright 2020 Google LLC
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef JSNONNET_BASE_TRANSACTION_H_
|
|
#define JSNONNET_BASE_TRANSACTION_H_
|
|
|
|
#include "jsonnet_base_sandbox.h" // NOLINT(build/include)
|
|
|
|
class JsonnetTransaction : public sapi::Transaction {
|
|
public:
|
|
JsonnetTransaction(std::string in_file, std::string out_file)
|
|
: sapi::Transaction(
|
|
std::make_unique<JsonnetBaseSandbox>(in_file, out_file)),
|
|
in_file_(in_file),
|
|
out_file_(out_file) {
|
|
sapi::Transaction::set_retry_count(0); // Try once, no retries
|
|
sapi::Transaction::SetTimeLimit(0); // Infinite time limit
|
|
}
|
|
|
|
private:
|
|
std::string in_file_;
|
|
std::string out_file_;
|
|
|
|
absl::Status Main() override;
|
|
};
|
|
|
|
#endif // JSNONNET_BASE_TRANSACTION_H_
|