From de63e79d5b5898dfe13d0b67b3189c99ee228dc0 Mon Sep 17 00:00:00 2001 From: Evgenii Kliuchnikov Date: Tue, 7 Jul 2026 01:06:49 -0700 Subject: [PATCH] internal change PiperOrigin-RevId: 943733082 --- c/common/shared_dictionary.c | 2 ++ c/enc/encode.c | 4 ++++ c/enc/encoder_dict.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/c/common/shared_dictionary.c b/c/common/shared_dictionary.c index cef4e20fc..b67ce098d 100644 --- a/c/common/shared_dictionary.c +++ b/c/common/shared_dictionary.c @@ -465,9 +465,11 @@ BROTLI_BOOL BrotliSharedDictionaryAttach( return BROTLI_FALSE; } #if defined(BROTLI_EXPERIMENTAL) + /* copybara:insert(don't want that in production) if (type == BROTLI_SHARED_DICTIONARY_SERIALIZED) { return DecodeSharedDictionary(data, data_size, dict); } + */ #endif /* BROTLI_EXPERIMENTAL */ if (type == BROTLI_SHARED_DICTIONARY_RAW) { if (dict->num_prefix >= SHARED_BROTLI_MAX_COMPOUND_DICTS) { diff --git a/c/enc/encode.c b/c/enc/encode.c index b2583e489..cb66f72e3 100644 --- a/c/enc/encode.c +++ b/c/enc/encode.c @@ -1738,7 +1738,9 @@ BrotliEncoderPreparedDictionary* BrotliEncoderPrepareDictionary( BROTLI_BOOL type_is_known = BROTLI_FALSE; type_is_known |= (type == BROTLI_SHARED_DICTIONARY_RAW); #if defined(BROTLI_EXPERIMENTAL) + /* copybara:insert(don't want that in production) type_is_known |= (type == BROTLI_SHARED_DICTIONARY_SERIALIZED); + */ #endif /* BROTLI_EXPERIMENTAL */ if (!type_is_known) { return NULL; @@ -1753,6 +1755,7 @@ BrotliEncoderPreparedDictionary* BrotliEncoderPrepareDictionary( &managed_dictionary->memory_manager_, data, size); } #if defined(BROTLI_EXPERIMENTAL) + /* copybara:insert(don't want that in production) if (type == BROTLI_SHARED_DICTIONARY_SERIALIZED) { SharedEncoderDictionary* dict = (SharedEncoderDictionary*)BrotliAllocate( &managed_dictionary->memory_manager_, sizeof(SharedEncoderDictionary)); @@ -1766,6 +1769,7 @@ BrotliEncoderPreparedDictionary* BrotliEncoderPrepareDictionary( } } } + */ #else /* BROTLI_EXPERIMENTAL */ (void)quality; #endif /* BROTLI_EXPERIMENTAL */ diff --git a/c/enc/encoder_dict.c b/c/enc/encoder_dict.c index f75ee5984..7c44590ce 100644 --- a/c/enc/encoder_dict.c +++ b/c/enc/encoder_dict.c @@ -582,8 +582,12 @@ BROTLI_BOOL BrotliInitCustomSharedEncoderDictionary( if (!decoded_dict) { /* OOM */ return BROTLI_FALSE; } + /* copybara:strip_begin(do not enable feature in production) */ + success = BROTLI_FALSE; + /* copybara:strip_end_and_replace success = BrotliSharedDictionaryAttach( decoded_dict, BROTLI_SHARED_DICTIONARY_SERIALIZED, size, encoded_dict); + */ if (success) { success = InitCustomSharedEncoderDictionary(m, decoded_dict, quality, dict);