EGL BlobCache: Add CRC check to multifile
Apply a CRC check during file write, ensuring it is
the last thing applied to the file.
During initialization, verify the contents of the file
and remove if CRC doesn't match.
Add a new test (ModifiedCacheEndMisses) that modifies
the end of the entry and ensures no cache hit.
Test: pubg_mobile_launch ANGLE trace
Test: /data/nativetest64/EGL_test/EGL_test
Test: /data/nativetest64/libEGL_test/libEGL_test
Bug: b/267629017
Change-Id: I54015548b509c9ef2440e80f35b5ec97820a2144
diff --git a/opengl/libs/EGL/MultifileBlobCache.h b/opengl/libs/EGL/MultifileBlobCache.h
index c0cc9dc..cb105fb 100644
--- a/opengl/libs/EGL/MultifileBlobCache.h
+++ b/opengl/libs/EGL/MultifileBlobCache.h
@@ -28,9 +28,13 @@
#include <unordered_map>
#include <unordered_set>
+#include "FileBlobCache.h"
+
namespace android {
struct MultifileHeader {
+ uint32_t magic;
+ uint32_t crc;
EGLsizeiANDROID keySize;
EGLsizeiANDROID valueSize;
};