diff options
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/disable-download-quarantine.patch')
| -rw-r--r-- | www/chromium-uc/patches/extra/ungoogled-chromium/disable-download-quarantine.patch | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/disable-download-quarantine.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/disable-download-quarantine.patch index 88caa9d..2191bbe 100644 --- a/www/chromium-uc/patches/extra/ungoogled-chromium/disable-download-quarantine.patch +++ b/www/chromium-uc/patches/extra/ungoogled-chromium/disable-download-quarantine.patch | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | # Disables file download quarantining | 1 | # Disables file download quarantining |
| 2 | 2 | ||
| 3 | --- a/components/download/internal/common/base_file.cc | 3 | --- components/download/internal/common/base_file.cc.orig |
| 4 | +++ b/components/download/internal/common/base_file.cc | 4 | +++ components/download/internal/common/base_file.cc |
| 5 | @@ -22,7 +22,6 @@ | 5 | @@ -23,7 +23,6 @@ |
| 6 | #include "components/download/public/common/download_interrupt_reasons_utils.h" | 6 | #include "components/download/public/common/download_interrupt_reasons_utils.h" |
| 7 | #include "components/download/public/common/download_item.h" | 7 | #include "components/download/public/common/download_item.h" |
| 8 | #include "components/download/public/common/download_stats.h" | 8 | #include "components/download/public/common/download_stats.h" |
| 9 | -#include "components/services/quarantine/quarantine.h" | 9 | -#include "components/services/quarantine/quarantine.h" |
| 10 | #include "crypto/secure_hash.h" | 10 | #include "crypto/secure_hash.h" |
| 11 | 11 | ||
| 12 | #if BUILDFLAG(IS_ANDROID) | 12 | #if defined(OS_WIN) |
| 13 | @@ -525,102 +524,6 @@ DownloadInterruptReason BaseFile::Publis | 13 | @@ -535,105 +534,6 @@ DownloadInterruptReason BaseFile::Publis |
| 14 | } | 14 | } |
| 15 | #endif // BUILDFLAG(IS_ANDROID) | 15 | #endif // defined(OS_ANDROID) |
| 16 | 16 | ||
| 17 | -namespace { | 17 | -namespace { |
| 18 | - | 18 | - |
| @@ -102,24 +102,27 @@ | |||
| 102 | - | 102 | - |
| 103 | -void BaseFile::OnQuarantineServiceError(const GURL& source_url, | 103 | -void BaseFile::OnQuarantineServiceError(const GURL& source_url, |
| 104 | - const GURL& referrer_url) { | 104 | - const GURL& referrer_url) { |
| 105 | -#if BUILDFLAG(IS_WIN) | 105 | -#if defined(OS_WIN) |
| 106 | - OnFileQuarantined(/*connection_error=*/true, | 106 | - if (base::FeatureList::IsEnabled(quarantine::kOutOfProcessQuarantine)) { |
| 107 | - quarantine::SetInternetZoneIdentifierDirectly( | 107 | - OnFileQuarantined(/*connection_error=*/true, |
| 108 | - full_path_, source_url, referrer_url)); | 108 | - quarantine::SetInternetZoneIdentifierDirectly( |
| 109 | -#else // !BUILDFLAG(IS_WIN) | 109 | - full_path_, source_url, referrer_url)); |
| 110 | - return; | ||
| 111 | - } | ||
| 112 | -#endif // defined(OS_WIN) | ||
| 113 | - | ||
| 110 | - CHECK(false) << "In-process quarantine service should not have failed."; | 114 | - CHECK(false) << "In-process quarantine service should not have failed."; |
| 111 | -#endif // !BUILDFLAG(IS_WIN) | ||
| 112 | -} | 115 | -} |
| 113 | 116 | ||
| 114 | void BaseFile::AnnotateWithSourceInformation( | 117 | void BaseFile::AnnotateWithSourceInformation( |
| 115 | const std::string& client_guid, | 118 | const std::string& client_guid, |
| 116 | @@ -628,32 +531,8 @@ void BaseFile::AnnotateWithSourceInforma | 119 | @@ -641,32 +541,8 @@ void BaseFile::AnnotateWithSourceInforma |
| 117 | const GURL& referrer_url, | 120 | const GURL& referrer_url, |
| 118 | mojo::PendingRemote<quarantine::mojom::Quarantine> remote_quarantine, | 121 | mojo::PendingRemote<quarantine::mojom::Quarantine> remote_quarantine, |
| 119 | OnAnnotationDoneCallback on_annotation_done_callback) { | 122 | OnAnnotationDoneCallback on_annotation_done_callback) { |
| 120 | - GURL authority_url = GetEffectiveAuthorityURL(source_url, referrer_url); | 123 | - GURL authority_url = GetEffectiveAuthorityURL(source_url, referrer_url); |
| 121 | - if (!remote_quarantine) { | 124 | - if (!remote_quarantine) { |
| 122 | -#if BUILDFLAG(IS_WIN) | 125 | -#if defined(OS_WIN) |
| 123 | - quarantine::mojom::QuarantineFileResult result = | 126 | - quarantine::mojom::QuarantineFileResult result = |
| 124 | - quarantine::SetInternetZoneIdentifierDirectly(full_path_, authority_url, | 127 | - quarantine::SetInternetZoneIdentifierDirectly(full_path_, authority_url, |
| 125 | - referrer_url); | 128 | - referrer_url); |
| @@ -148,9 +151,9 @@ | |||
| 148 | } | 151 | } |
| 149 | 152 | ||
| 150 | } // namespace download | 153 | } // namespace download |
| 151 | --- a/content/browser/BUILD.gn | 154 | --- content/browser/BUILD.gn.orig |
| 152 | +++ b/content/browser/BUILD.gn | 155 | +++ content/browser/BUILD.gn |
| 153 | @@ -85,7 +85,6 @@ source_set("browser") { | 156 | @@ -82,7 +82,6 @@ source_set("browser") { |
| 154 | "//components/permissions:permissions_common", | 157 | "//components/permissions:permissions_common", |
| 155 | "//components/power_scheduler", | 158 | "//components/power_scheduler", |
| 156 | "//components/services/filesystem:lib", | 159 | "//components/services/filesystem:lib", |
| @@ -158,17 +161,17 @@ | |||
| 158 | "//components/services/storage", | 161 | "//components/services/storage", |
| 159 | "//components/services/storage:filesystem_proxy_factory", | 162 | "//components/services/storage:filesystem_proxy_factory", |
| 160 | "//components/services/storage/dom_storage:local_storage_proto", | 163 | "//components/services/storage/dom_storage:local_storage_proto", |
| 161 | --- a/content/browser/file_system_access/safe_move_helper.cc | 164 | --- content/browser/file_system_access/safe_move_helper.cc.orig |
| 162 | +++ b/content/browser/file_system_access/safe_move_helper.cc | 165 | +++ content/browser/file_system_access/safe_move_helper.cc |
| 163 | @@ -13,7 +13,6 @@ | 166 | @@ -12,7 +12,6 @@ |
| 167 | #include "base/task/thread_pool.h" | ||
| 164 | #include "base/threading/sequenced_task_runner_handle.h" | 168 | #include "base/threading/sequenced_task_runner_handle.h" |
| 165 | #include "build/build_config.h" | 169 | #include "build/build_config.h" |
| 166 | #include "build/chromeos_buildflags.h" | ||
| 167 | -#include "components/services/quarantine/quarantine.h" | 170 | -#include "components/services/quarantine/quarantine.h" |
| 168 | #include "content/browser/file_system_access/file_system_access_error.h" | 171 | #include "content/browser/file_system_access/file_system_access_error.h" |
| 169 | #include "content/public/browser/content_browser_client.h" | 172 | #include "content/public/browser/content_browser_client.h" |
| 170 | #include "content/public/browser/global_routing_id.h" | 173 | #include "content/public/common/content_client.h" |
| 171 | @@ -197,20 +196,8 @@ void SafeMoveHelper::DidAfterWriteCheck( | 174 | @@ -193,20 +192,8 @@ void SafeMoveHelper::DidAfterWriteCheck( |
| 172 | // not exist anymore. In case of error, the source file URL will point to a | 175 | // not exist anymore. In case of error, the source file URL will point to a |
| 173 | // valid filesystem location. | 176 | // valid filesystem location. |
| 174 | base::OnceCallback<void(base::File::Error)> result_callback; | 177 | base::OnceCallback<void(base::File::Error)> result_callback; |
| @@ -187,9 +190,9 @@ | |||
| 187 | weak_factory_.GetWeakPtr()); | 190 | weak_factory_.GetWeakPtr()); |
| 188 | - } | 191 | - } |
| 189 | manager_->DoFileSystemOperation( | 192 | manager_->DoFileSystemOperation( |
| 190 | FROM_HERE, &storage::FileSystemOperationRunner::Move, | 193 | FROM_HERE, &storage::FileSystemOperationRunner::MoveFileLocal, |
| 191 | std::move(result_callback), source_url(), dest_url(), options_, | 194 | std::move(result_callback), source_url(), dest_url(), option_); |
| 192 | @@ -226,7 +213,6 @@ void SafeMoveHelper::DidFileSkipQuaranti | 195 | @@ -220,7 +207,6 @@ void SafeMoveHelper::DidFileSkipQuaranti |
| 193 | void SafeMoveHelper::DidFileDoQuarantine( | 196 | void SafeMoveHelper::DidFileDoQuarantine( |
| 194 | const storage::FileSystemURL& target_url, | 197 | const storage::FileSystemURL& target_url, |
| 195 | const GURL& referrer_url, | 198 | const GURL& referrer_url, |
| @@ -197,7 +200,7 @@ | |||
| 197 | base::File::Error result) { | 200 | base::File::Error result) { |
| 198 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 201 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 199 | 202 | ||
| 200 | @@ -257,37 +243,9 @@ void SafeMoveHelper::DidFileDoQuarantine | 203 | @@ -251,37 +237,9 @@ void SafeMoveHelper::DidFileDoQuarantine |
| 201 | referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS() | 204 | referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS() |
| 202 | ? referrer_url | 205 | ? referrer_url |
| 203 | : GURL(); | 206 | : GURL(); |
| @@ -215,7 +218,7 @@ | |||
| 215 | - std::move(quarantine_remote)), | 218 | - std::move(quarantine_remote)), |
| 216 | - quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED)); | 219 | - quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED)); |
| 217 | - } else { | 220 | - } else { |
| 218 | -#if BUILDFLAG(IS_WIN) | 221 | -#if defined(OS_WIN) |
| 219 | - base::ThreadPool::PostTaskAndReplyWithResult( | 222 | - base::ThreadPool::PostTaskAndReplyWithResult( |
| 220 | - FROM_HERE, {base::MayBlock()}, | 223 | - FROM_HERE, {base::MayBlock()}, |
| 221 | - base::BindOnce(&quarantine::SetInternetZoneIdentifierDirectly, | 224 | - base::BindOnce(&quarantine::SetInternetZoneIdentifierDirectly, |
| @@ -235,8 +238,8 @@ | |||
| 235 | quarantine::mojom::QuarantineFileResult result) { | 238 | quarantine::mojom::QuarantineFileResult result) { |
| 236 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 239 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 237 | 240 | ||
| 238 | --- a/content/browser/file_system_access/safe_move_helper.h | 241 | --- content/browser/file_system_access/safe_move_helper.h.orig |
| 239 | +++ b/content/browser/file_system_access/safe_move_helper.h | 242 | +++ content/browser/file_system_access/safe_move_helper.h |
| 240 | @@ -58,10 +58,8 @@ class CONTENT_EXPORT SafeMoveHelper { | 243 | @@ -58,10 +58,8 @@ class CONTENT_EXPORT SafeMoveHelper { |
| 241 | void DidFileDoQuarantine( | 244 | void DidFileDoQuarantine( |
| 242 | const storage::FileSystemURL& target_url, | 245 | const storage::FileSystemURL& target_url, |
| @@ -248,30 +251,30 @@ | |||
| 248 | quarantine::mojom::QuarantineFileResult result); | 251 | quarantine::mojom::QuarantineFileResult result); |
| 249 | 252 | ||
| 250 | void ComputeHashForSourceFile(HashCallback callback); | 253 | void ComputeHashForSourceFile(HashCallback callback); |
| 251 | --- a/content/browser/renderer_host/pepper/pepper_file_io_host.cc | 254 | --- content/browser/renderer_host/pepper/pepper_file_io_host.cc.orig |
| 252 | +++ b/content/browser/renderer_host/pepper/pepper_file_io_host.cc | 255 | +++ content/browser/renderer_host/pepper/pepper_file_io_host.cc |
| 253 | @@ -455,7 +455,7 @@ void PepperFileIOHost::OnLocalFileOpened | 256 | @@ -456,7 +456,7 @@ void PepperFileIOHost::OnLocalFileOpened |
| 254 | ppapi::host::ReplyMessageContext reply_context, | 257 | ppapi::host::ReplyMessageContext reply_context, |
| 255 | const base::FilePath& path, | 258 | const base::FilePath& path, |
| 256 | base::File::Error error_code) { | 259 | base::File::Error error_code) { |
| 257 | -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) | 260 | -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) |
| 258 | +#if 0 | 261 | +#if 0 |
| 259 | // Quarantining a file before its contents are available is only supported on | 262 | // Quarantining a file before its contents are available is only supported on |
| 260 | // Windows and Linux. | 263 | // Windows and Linux. |
| 261 | if (!FileOpenForWrite(open_flags_) || error_code != base::File::FILE_OK) { | 264 | if (!FileOpenForWrite(open_flags_) || error_code != base::File::FILE_OK) { |
| 262 | @@ -489,7 +489,7 @@ void PepperFileIOHost::OnLocalFileOpened | 265 | @@ -490,7 +490,7 @@ void PepperFileIOHost::OnLocalFileOpened |
| 263 | #endif | 266 | #endif |
| 264 | } | 267 | } |
| 265 | 268 | ||
| 266 | -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) | 269 | -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) |
| 267 | +#if 0 | 270 | +#if 0 |
| 268 | void PepperFileIOHost::OnLocalFileQuarantined( | 271 | void PepperFileIOHost::OnLocalFileQuarantined( |
| 269 | ppapi::host::ReplyMessageContext reply_context, | 272 | ppapi::host::ReplyMessageContext reply_context, |
| 270 | const base::FilePath& path, | 273 | const base::FilePath& path, |
| 271 | --- a/content/browser/renderer_host/pepper/pepper_file_io_host.h | 274 | --- content/browser/renderer_host/pepper/pepper_file_io_host.h.orig |
| 272 | +++ b/content/browser/renderer_host/pepper/pepper_file_io_host.h | 275 | +++ content/browser/renderer_host/pepper/pepper_file_io_host.h |
| 273 | @@ -13,7 +13,6 @@ | 276 | @@ -13,7 +13,6 @@ |
| 274 | #include "base/memory/raw_ptr.h" | 277 | #include "base/macros.h" |
| 275 | #include "base/memory/ref_counted.h" | 278 | #include "base/memory/ref_counted.h" |
| 276 | #include "base/memory/weak_ptr.h" | 279 | #include "base/memory/weak_ptr.h" |
| 277 | -#include "components/services/quarantine/public/mojom/quarantine.mojom.h" | 280 | -#include "components/services/quarantine/public/mojom/quarantine.mojom.h" |
