| Code-Review | +1 | 
Nice!! This turned out to be relatively straightforward; perfect for MVP. Business logic LGTM (I'm not familiar with the idiosyncrasies if any in the snappy and zstd libraries).
  // LINT.ThenChange(//tools/metrics/histograms/metadata/storage/enums.xml:IndexedDbSqliteSpecificEvent)Don't we need to update enums.xml? Wonder why the lint didn't work.
  return DoDecompress(compressed, compression_type)
      .or_else([&](Status status) -> StatusOr<std::vector<uint8_t>> {
        return base::unexpected(
            Fatal(status, SpecificEvent::kDecompressionFailure));
      });`transform_error` is probably more appropriate here since we don't wish to call any function that returns a `base::expected`, i.e., this should work:
```suggestion
return DoDecompress(compressed, compression_type)
.transform_error([&](Status status){
return Fatal(status, SpecificEvent::kDecompressionFailure);
});
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | 
  // LINT.ThenChange(//tools/metrics/histograms/metadata/storage/enums.xml:IndexedDbSqliteSpecificEvent)Don't we need to update enums.xml? Wonder why the lint didn't work.
oh yeah, thanks for reminder. I believe the lint bot remarks are is only visible to Googlers, or something --- I did get pinged about a similar lint failure in the past by a Google metrics reviewer.
  return DoDecompress(compressed, compression_type)
      .or_else([&](Status status) -> StatusOr<std::vector<uint8_t>> {
        return base::unexpected(
            Fatal(status, SpecificEvent::kDecompressionFailure));
      });`transform_error` is probably more appropriate here since we don't wish to call any function that returns a `base::expected`, i.e., this should work:
```suggestion
return DoDecompress(compressed, compression_type)
.transform_error([&](Status status){
return Fatal(status, SpecificEvent::kDecompressionFailure);
});
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | 
| Code-Review | +1 | 
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | 
| Code-Review | +1 | 
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | 
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | 
IDB: compress rows in SQLite store
Implements a straightforward compression of IDB values prior to storing
on disk. See doc linked in crbug for discussion.
Prior testing has shown ZSTD to have performance (time, compression
ratio) comparable to or slightly better than Snappy. ZSTD is the
preferred compression algorithm for this reason and because its
performance is tunable, in addition to having some more sophisticated
features of potential future use. We will be able to perform real-world
experiments with compression level and some other parameters (and also
compare to Snappy), but for now some reasonable defaults are assumed.
Snappy compression is also included in this patch as a fallback for
size-constrained platforms (Android, Fuchsia), which do not already
include ZSTD's compression library, although they do include
decompression. (In this change, the decompression code is included on
those platforms because it's cheap/easy to include, and on the off
chance someone copies data from a Chromium profile on a system that did
use ZSTD for compression to one of these devices).
Since the SQLite backing store is not live, this shouldn't affect real
users. We will soon start deploying the SQLite store to real users for
in-memory profiles (such as Incognito), which is an ideal testing ground
for compression performance.
Test coverage is provided by existing tests, and there will be more
specific tests added when we add the ability to tweak and monitor
behavior (for experimentation).
Bug: 436887362
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |