#include "base/nix/mime_util_xdg.h"
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/containers/stack.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/nix/xdg_util.h"
#include "base/no_destructor.h"
#include "base/numerics/byte_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "build/build_config.h"
#if !BUILDFLAG(IS_CHROMEOS)
#include "base/synchronization/lock.h"
#endif
namespace base::nix {
namespace {
constexpr size_t kMaxMimeTypesFileSize = …;
constexpr size_t kMaxNodes = …;
constexpr size_t kMaxExtSize = …;
constexpr size_t kHeaderSize = …;
constexpr uint32_t kMaxUnicode = …;
constexpr uint8_t kDefaultGlobWeight = …;
struct FileInfo { … };
void LoadAllMimeCacheFiles(MimeTypeMap& map, std::vector<FileInfo>& files) { … }
bool ReadInt(const std::string& buf,
uint32_t offset,
const std::string& field_name,
uint32_t min_result,
size_t max_result,
uint32_t* result) { … }
}
bool ParseMimeTypes(const FilePath& file_path, MimeTypeMap& out_mime_types) { … }
std::string GetFileMimeType(const FilePath& filepath) { … }
}