blob: 260a442dda344baffc4545d91d533b519eef48aa [file] [log] [blame]
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <bsdiff/compressor_interface.h>
#include <bsdiff/brotli_compressor.h>
#include <bsdiff/bz2_compressor.h>
namespace bsdiff {
std::unique_ptr<CompressorInterface> CreateCompressor(CompressorType type) {
if (type == CompressorType::kBrotli) {
return std::unique_ptr<CompressorInterface>(new BrotliCompressor());
}
// Use BZ2 as a default compressor.
return std::unique_ptr<CompressorInterface>(new BZ2Compressor());
}
} // namespace bsdiff