repo/testing/chromium/patches/disable-download-quarantine.patch

99 lines
3.5 KiB
Diff

# Disables file download quarantining
--- a/content/browser/renderer_host/pepper/pepper_file_io_host.cc
+++ b/content/browser/renderer_host/pepper/pepper_file_io_host.cc
@@ -432,7 +432,7 @@ void PepperFileIOHost::OnLocalFileOpened
ppapi::host::ReplyMessageContext reply_context,
const base::FilePath& path,
base::File::Error error_code) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if 0
// Quarantining a file before its contents are available is only supported on
// Windows and Linux.
if (!FileOpenForWrite(open_flags_) || error_code != base::File::FILE_OK) {
@@ -452,7 +452,7 @@ void PepperFileIOHost::OnLocalFileOpened
#endif
}
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if 0
void PepperFileIOHost::OnLocalFileQuarantined(
ppapi::host::ReplyMessageContext reply_context,
const base::FilePath& path,
--- a/content/browser/renderer_host/pepper/pepper_file_io_host.h
+++ b/content/browser/renderer_host/pepper/pepper_file_io_host.h
@@ -15,7 +15,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "components/download/quarantine/quarantine.h"
#include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_platform_file.h"
@@ -92,10 +91,6 @@ class PepperFileIOHost : public ppapi::h
const base::FilePath& path,
base::File::Error error_code);
- void OnLocalFileQuarantined(ppapi::host::ReplyMessageContext reply_context,
- const base::FilePath& path,
- download::QuarantineFileResult quarantine_result);
-
void SendFileOpenReply(ppapi::host::ReplyMessageContext reply_context,
base::File::Error error_code);
--- a/components/download/internal/common/base_file.cc
+++ b/components/download/internal/common/base_file.cc
@@ -22,7 +22,6 @@
#include "components/download/public/common/download_interrupt_reasons_utils.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/download_stats.h"
-#include "components/download/quarantine/quarantine.h"
#include "crypto/secure_hash.h"
#if defined(OS_ANDROID)
@@ -494,7 +493,7 @@ DownloadInterruptReason BaseFile::Publis
}
#endif // defined(OS_ANDROID)
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
+#if 0
namespace {
@@ -578,7 +577,7 @@ DownloadInterruptReason BaseFile::Annota
}
return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
}
-#else // !OS_WIN && !OS_MACOSX && !OS_LINUX
+#else // 1
DownloadInterruptReason BaseFile::AnnotateWithSourceInformation(
const std::string& client_guid,
const GURL& source_url,
--- a/components/download/quarantine/quarantine.cc
+++ b/components/download/quarantine/quarantine.cc
@@ -6,8 +6,6 @@
#include "build/build_config.h"
-#if !defined(OS_WIN) && !defined(OS_MACOSX)
-
namespace download {
QuarantineFileResult QuarantineFile(const base::FilePath& file,
@@ -18,5 +16,3 @@ QuarantineFileResult QuarantineFile(cons
}
} // namespace download
-
-#endif // !WIN && !MAC
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -51,7 +51,6 @@ jumbo_source_set("browser") {
"//components/discardable_memory/service",
"//components/download/database",
"//components/download/public/common:public",
- "//components/download/quarantine",
"//components/filename_generation",
"//components/link_header_util",
"//components/metrics",