<commit_before>#include "extensions/filters/http/original_src/original_src_config_factory.h"

#include "envoy/registry/registry.h"

#include "extensions/filters/http/original_src/config.h"
#include "extensions/filters/http/original_src/original_src.h"
#include "extensions/filters/http/well_known_names.h"

namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace OriginalSrc {

Http::FilterFactoryCb OriginalSrcConfigFactory::createFilterFactoryFromProtoTyped(
    const envoy::config::filter::http::original_src::v2alpha1::OriginalSrc& proto_config,
    const std::string&, Server::Configuration::FactoryContext&) {
  Config config(proto_config);
  return [config](Http::FilterChainFactoryCallbacks& callbacks) -> void {
    callbacks.addStreamDecoderFilter(std::make_unique<OriginalSrcFilter>(config));
  };
}

/**
 * Static registration for the original_src filter. @see RegisterFactory.
 */
REGISTER_FACTORY(OriginalSrcConfigFactory, Server::Configuration::NamedHttpFilterConfigFactory);

} // namespace OriginalSrc
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy<commit_msg>Use shared instead of unique ptr to avoid conversion (#8677)<commit_after>#include "extensions/filters/http/original_src/original_src_config_factory.h"

#include "envoy/registry/registry.h"

#include "extensions/filters/http/original_src/config.h"
#include "extensions/filters/http/original_src/original_src.h"
#include "extensions/filters/http/well_known_names.h"

namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace OriginalSrc {

Http::FilterFactoryCb OriginalSrcConfigFactory::createFilterFactoryFromProtoTyped(
    const envoy::config::filter::http::original_src::v2alpha1::OriginalSrc& proto_config,
    const std::string&, Server::Configuration::FactoryContext&) {
  Config config(proto_config);
  return [config](Http::FilterChainFactoryCallbacks& callbacks) -> void {
    callbacks.addStreamDecoderFilter(std::make_shared<OriginalSrcFilter>(config));
  };
}

/**
 * Static registration for the original_src filter. @see RegisterFactory.
 */
REGISTER_FACTORY(OriginalSrcConfigFactory, Server::Configuration::NamedHttpFilterConfigFactory);

} // namespace OriginalSrc
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy
{'fraction_non_alphanumeric': 0.11372549019607843, 'fraction_numerical': 0.003485838779956427, 'mean_word_length': 7.37956204379562, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4825907', 'n_tokens_mistral': 644, 'n_tokens_neox': 643, 'n_words': 110}