Simplify cached_metadata_handler.h
The main purpose is to replace the default CacheType argument with a normal one. The callers are already passing this parameter explicitly in the vast majority of cases, as it is really helpful to know whether the operation will be persisted across platform instances. For ClearCachedMetadata(): all callers are passing the parameter explicitly. We will continue to need both modes (clearing on disk for privacy reasons, clearing from memory to free up some memory). Making it non-default is trivial. For SetCachedMetadata(): the documentation says that is should always persist, hence it seems that this was the intention initially. The kCacheLocally is used only in tests. Making a test-only carveout with DisableSendToPlatformForTesting(). The reason for not persisting in those tests is not clear to me, perhaps this makes the tests run faster? Increasing the size of the class is slightly unfortunate, I could not find an elegant solution to overcome this. Though the size of these objects is small compared to all of the serialized data, so it feels OK. Bug: 1045052 Change-Id: Ifec42fbd66498c6860b32d86a25d3e857a97b4c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019246Reviewed-by:Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by:
Leszek Swirski <leszeks@chromium.org> Reviewed-by:
Jeremy Roman <jbroman@chromium.org> Auto-Submit: Egor Pasko <pasko@chromium.org> Commit-Queue: Egor Pasko <pasko@chromium.org> Cr-Commit-Position: refs/heads/master@{#736869}
Showing
Please register or sign in to comment