aboutsummaryrefslogtreecommitdiff
path: root/icing/file/file-backed-proto-log.h
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-27 16:37:59 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-27 16:37:59 +0000
commit0e42c1c9f44ee8b52d7f59503d4b2f610217228d (patch)
tree69c5b6c2253d521b1c26f1e6b4bb1cfe571c907e /icing/file/file-backed-proto-log.h
parent4f7fa20382e5e06e9b56a477478a8ea921ccfc79 (diff)
parent8f16167c39d77866a213b0ef042058e858255d47 (diff)
downloadicing-androidx-sharetarget-release.tar.gz
Snap for 8755081 from 8f16167c39d77866a213b0ef042058e858255d47 to androidx-sharetarget-releaseandroidx-sharetarget-release
Change-Id: I48cc3b5162a457d89cd505e8ceec7c253106fa87
Diffstat (limited to 'icing/file/file-backed-proto-log.h')
-rw-r--r--icing/file/file-backed-proto-log.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/icing/file/file-backed-proto-log.h b/icing/file/file-backed-proto-log.h
index cf16b4f..686b4fb 100644
--- a/icing/file/file-backed-proto-log.h
+++ b/icing/file/file-backed-proto-log.h
@@ -40,13 +40,13 @@
#include <string_view>
#include "icing/text_classifier/lib3/utils/base/statusor.h"
-#include <google/protobuf/io/gzip_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
#include "icing/absl_ports/canonical_errors.h"
#include "icing/absl_ports/str_cat.h"
#include "icing/file/filesystem.h"
#include "icing/file/memory-mapped-file.h"
#include "icing/legacy/core/icing-string-util.h"
+#include "icing/portable/gzip_stream.h"
#include "icing/portable/platform.h"
#include "icing/portable/zlib.h"
#include "icing/util/crc32.h"
@@ -292,9 +292,6 @@ class FileBackedProtoLog {
static_assert(kMaxProtoSize <= 0x00FFFFFF,
"kMaxProtoSize doesn't fit in 3 bytes");
- // Level of compression, BEST_SPEED = 1, BEST_COMPRESSION = 9
- static constexpr int kDeflateCompressionLevel = 3;
-
// Chunks of the file to mmap at a time, so we don't mmap the entire file.
// Only used on 32-bit devices
static constexpr int kMmapChunkSize = 4 * 1024 * 1024; // 4MiB
@@ -306,9 +303,6 @@ class FileBackedProtoLog {
};
template <typename ProtoT>
-constexpr uint8_t FileBackedProtoLog<ProtoT>::kProtoMagic;
-
-template <typename ProtoT>
FileBackedProtoLog<ProtoT>::FileBackedProtoLog(const Filesystem* filesystem,
const std::string& file_path,
std::unique_ptr<Header> header)
@@ -582,7 +576,7 @@ libtextclassifier3::StatusOr<ProtoT> FileBackedProtoLog<ProtoT>::ReadProto(
// Deserialize proto
ProtoT proto;
if (header_->compress) {
- google::protobuf::io::GzipInputStream decompress_stream(&proto_stream);
+ protobuf_ports::GzipInputStream decompress_stream(&proto_stream);
proto.ParseFromZeroCopyStream(&decompress_stream);
} else {
proto.ParseFromZeroCopyStream(&proto_stream);