From b7ef11fa70d940033e95f63ef4203a762c536634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Cantar=C3=ADn?= Date: Tue, 22 Jun 2021 15:57:51 -0300 Subject: [PATCH] Workaround warning spam using http_file Fixes #948. --- packager/file/file.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packager/file/file.cc b/packager/file/file.cc index 01b16f76c4..653598b4eb 100644 --- a/packager/file/file.cc +++ b/packager/file/file.cc @@ -210,12 +210,22 @@ File* File::OpenWithNoBuffering(const char* file_name, const char* mode) { } bool File::Delete(const char* file_name) { + static bool logged = false; base::StringPiece real_file_name; const FileTypeInfo* file_type = GetFileTypeInfo(file_name, &real_file_name); DCHECK(file_type); - return file_type->delete_function - ? file_type->delete_function(real_file_name.data()) - : false; + if (file_type->delete_function) { + return file_type->delete_function(real_file_name.data()); + } else { + if (!logged) { + logged = true; + LOG(WARNING) << "File::Delete: file type for " + << file_name + << " ('" << file_type->type << "') " + << "has no 'delete' function."; + } + return true; + } } int64_t File::GetFileSize(const char* file_name) {