Allow sandboxes to specify custom notifiers.

PiperOrigin-RevId: 334154462
Change-Id: Ia62242913731ab017a9bf8733a77a647582af243
This commit is contained in:
Sandboxed API Team 2020-09-28 07:38:07 -07:00 committed by Copybara-Service
parent cd75f94094
commit 376ca05c56
2 changed files with 4 additions and 1 deletions

View File

@ -201,7 +201,7 @@ absl::Status Sandbox::Init() {
ModifyExecutor(executor.get());
s2_ = absl::make_unique<sandbox2::Sandbox2>(std::move(executor),
std::move(s2p));
std::move(s2p), CreateNotifier());
auto res = s2_->RunAsync();
comms_ = s2_->comms();

View File

@ -141,6 +141,9 @@ class Sandbox {
// Modifies the Executor object if needed.
virtual void ModifyExecutor(sandbox2::Executor* executor) {}
// Provides a custom notifier for sandboxee events. May return nullptr.
virtual std::unique_ptr<sandbox2::Notify> CreateNotifier() { return nullptr; }
// Exits the sandboxee.
void Exit() const;