From 7722c07d0c566edac0d35ce228347c87311ccdbb Mon Sep 17 00:00:00 2001 From: Wiktor Garbacz Date: Thu, 3 Aug 2023 07:39:37 -0700 Subject: [PATCH] Mark `Mounts::RecursivelyListMounts()` const PiperOrigin-RevId: 553472906 Change-Id: Ia222751fd4b978dece6ef12c6677db8f3092ac1b --- sandboxed_api/sandbox2/mounts.cc | 7 +++++-- sandboxed_api/sandbox2/mounts.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sandboxed_api/sandbox2/mounts.cc b/sandboxed_api/sandbox2/mounts.cc index 5ff9530..b480d0d 100644 --- a/sandboxed_api/sandbox2/mounts.cc +++ b/sandboxed_api/sandbox2/mounts.cc @@ -23,7 +23,9 @@ #include #include +#include #include +#include #include "google/protobuf/util/message_differencer.h" #include "absl/container/flat_hash_set.h" @@ -777,8 +779,9 @@ void RecursivelyListMountsImpl(const MountTree& tree, } // namespace -void Mounts::RecursivelyListMounts(std::vector* outside_entries, - std::vector* inside_entries) { +void Mounts::RecursivelyListMounts( + std::vector* outside_entries, + std::vector* inside_entries) const { RecursivelyListMountsImpl(GetMountTree(), "", outside_entries, inside_entries); } diff --git a/sandboxed_api/sandbox2/mounts.h b/sandboxed_api/sandbox2/mounts.h index 0b2e5ca..4e7392b 100644 --- a/sandboxed_api/sandbox2/mounts.h +++ b/sandboxed_api/sandbox2/mounts.h @@ -91,7 +91,7 @@ class Mounts { // inside_entries[i]. The elements of inside_entries are prefixed with either // 'R' (read-only) or 'W' (writable). void RecursivelyListMounts(std::vector* outside_entries, - std::vector* inside_entries); + std::vector* inside_entries) const; absl::StatusOr ResolvePath(absl::string_view path) const;