#include "net/base/filename_util_internal.h"
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "net/base/filename_util.h"
#include "net/base/mime_util.h"
#include "net/base/net_string_util.h"
#include "net/http/http_content_disposition.h"
#include "url/gurl.h"
namespace net {
namespace {
base::FilePath::StringType GetCorrectedExtensionUnsafe(
const std::string& mime_type,
bool ignore_extension,
const base::FilePath& file_name) { … }
}
void SanitizeGeneratedFileName(base::FilePath::StringType* filename,
bool replace_trailing) { … }
std::string GetFileNameFromURL(const GURL& url,
const std::string& referrer_charset,
bool* should_overwrite_extension) { … }
bool IsShellIntegratedExtension(const base::FilePath::StringType& extension) { … }
void EnsureSafeExtension(const std::string& mime_type,
bool ignore_extension,
base::FilePath* file_name) { … }
bool FilePathToString16(const base::FilePath& path, std::u16string* converted) { … }
std::u16string GetSuggestedFilenameImpl(
const GURL& url,
const std::string& content_disposition,
const std::string& referrer_charset,
const std::string& suggested_name,
const std::string& mime_type,
const std::string& default_name,
bool should_replace_extension,
ReplaceIllegalCharactersFunction replace_illegal_characters_function) { … }
base::FilePath GenerateFileNameImpl(
const GURL& url,
const std::string& content_disposition,
const std::string& referrer_charset,
const std::string& suggested_name,
const std::string& mime_type,
const std::string& default_file_name,
bool should_replace_extension,
ReplaceIllegalCharactersFunction replace_illegal_characters_function) { … }
}