diff options
author | 2020-01-08 16:02:50 +0000 | |
---|---|---|
committer | 2020-01-14 13:22:44 +0000 | |
commit | bd22bb0deddb236fbdfa8c5797cfd7f15c1a0c73 (patch) | |
tree | 42a94e36d2e358ab91211c3317e9c31896c9a5e2 /jni/node-inl.h | |
parent | e59ed6bc05f55439d9722973192476ff85dfc261 (diff) |
Const correctness handle / RedactionInfo.
Helps us CHECK that they're always constructed with valid
RedactionInfo etc.
Test: atest FuseDaemonHostTest
Test: atest fuse_node_test
Bug: 147274248
Change-Id: I2cc369574d14136521201b4c8b99fe22e7ec0463
Diffstat (limited to 'jni/node-inl.h')
-rw-r--r-- | jni/node-inl.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/jni/node-inl.h b/jni/node-inl.h index 5db14134e..487583cea 100644 --- a/jni/node-inl.h +++ b/jni/node-inl.h @@ -34,17 +34,21 @@ namespace mediaprovider { namespace fuse { struct handle { - explicit handle(const std::string& path) : path(path), fd(-1), ri(nullptr), cached(true){}; + explicit handle(const std::string& path, int fd, const RedactionInfo* ri, bool cached) + : path(path), fd(fd), ri(ri), cached(cached) { + CHECK(ri != nullptr); + } + const std::string path; - int fd; - std::unique_ptr<RedactionInfo> ri; - bool cached; + const int fd; + const std::unique_ptr<const RedactionInfo> ri; + const bool cached; ~handle() { close(fd); } }; struct dirhandle { - explicit dirhandle(DIR* dir) : d(dir), next_off(0){}; + explicit dirhandle(DIR* dir) : d(dir), next_off(0) { CHECK(dir != nullptr); } DIR* const d; off_t next_off; |