  void addStreamFilter(StreamFilterSharedPtr filter,
                       Matcher::MatchTreeSharedPtr<HttpMatchingData> match_tree) override {
    // Note that we share the match data and tree between the two filters to allow things like
    // matching on both request and response data.
    // TODO(snowp): The match tree might be fully evaluated twice, ideally we should expose
    // the result to both filters after the first match evaluation.
    if (match_tree) {
      auto matching_state = std::make_shared<FilterMatchState>(
          std::move(match_tree), std::make_shared<Matching::HttpMatchingDataImpl>());
      addStreamDecoderFilterWorker(filter, matching_state, true);
      addStreamEncoderFilterWorker(filter, std::move(matching_state), true);
      return;
    }

    addStreamDecoderFilterWorker(filter, nullptr, true);
    addStreamEncoderFilterWorker(filter, nullptr, true);
  }
  void addStreamFilter(StreamFilterSharedPtr filter,
                       Matcher::MatchTreeSharedPtr<HttpMatchingData> match_tree) override {
     
     
     
     
    if (match_tree) {
      auto matching_state = std::make_shared<FilterMatchState>(
          std::move(match_tree), std::make_shared<Matching::HttpMatchingDataImpl>());
      addStreamDecoderFilterWorker(filter, matching_state, true);
      addStreamEncoderFilterWorker(filter, std::move(matching_state), true);
      return;
    }

    addStreamDecoderFilterWorker(filter, nullptr, true);
    addStreamEncoderFilterWorker(filter, nullptr, true);
  }