Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions c/common/shared_dictionary.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions c/enc/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
Expand All @@ -1766,6 +1769,7 @@ BrotliEncoderPreparedDictionary* BrotliEncoderPrepareDictionary(
}
}
}
*/
#else /* BROTLI_EXPERIMENTAL */
(void)quality;
#endif /* BROTLI_EXPERIMENTAL */
Expand Down
4 changes: 4 additions & 0 deletions c/enc/encoder_dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading