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