90 lines
3.9 KiB
Diff
90 lines
3.9 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Mon, 12 Feb 2018 21:21:36 +0100
|
|
Subject: ungoogled-chromium: Disable webRTC log uploader
|
|
|
|
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
|
---
|
|
.../media/webrtc/webrtc_log_uploader.cc | 36 ++++---------------
|
|
.../media/webrtc/webrtc_logging_controller.cc | 1 +
|
|
chrome/browser/ui/browser_ui_prefs.cc | 2 +-
|
|
3 files changed, 8 insertions(+), 31 deletions(-)
|
|
|
|
diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
|
--- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
|
+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
|
@@ -128,36 +128,7 @@ void WebRtcLogUploader::OnLoggingStopped(
|
|
DCHECK(meta_data.get());
|
|
DCHECK(!upload_done_data.paths.directory.empty());
|
|
|
|
- std::string compressed_log = CompressLog(log_buffer.get());
|
|
-
|
|
- std::string local_log_id;
|
|
-
|
|
- if (base::PathExists(upload_done_data.paths.directory)) {
|
|
- webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.paths.directory);
|
|
-
|
|
- local_log_id = base::NumberToString(base::Time::Now().ToDoubleT());
|
|
- base::FilePath log_file_path =
|
|
- upload_done_data.paths.directory.AppendASCII(local_log_id)
|
|
- .AddExtension(FILE_PATH_LITERAL(".gz"));
|
|
- WriteCompressedLogToFile(compressed_log, log_file_path);
|
|
-
|
|
- base::FilePath log_list_path =
|
|
- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory(
|
|
- upload_done_data.paths.directory);
|
|
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id);
|
|
- }
|
|
-
|
|
- upload_done_data.local_log_id = local_log_id;
|
|
-
|
|
- if (is_text_log_upload_allowed) {
|
|
- PrepareMultipartPostData(compressed_log, std::move(meta_data),
|
|
- std::move(upload_done_data));
|
|
- } else {
|
|
- main_task_runner_->PostTask(
|
|
- FROM_HERE,
|
|
- base::BindOnce(&WebRtcLogUploader::NotifyUploadDisabled,
|
|
- base::Unretained(this), std::move(upload_done_data)));
|
|
- }
|
|
+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data));
|
|
}
|
|
|
|
void WebRtcLogUploader::PrepareMultipartPostData(
|
|
@@ -168,6 +139,11 @@ void WebRtcLogUploader::PrepareMultipartPostData(
|
|
DCHECK(!compressed_log.empty());
|
|
DCHECK(meta_data.get());
|
|
|
|
+ if ((true)) {
|
|
+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data));
|
|
+ return;
|
|
+ }
|
|
+
|
|
std::unique_ptr<std::string> post_data(new std::string());
|
|
SetupMultipart(post_data.get(), compressed_log,
|
|
upload_done_data.paths.incoming_rtp_dump,
|
|
diff --git a/chrome/browser/media/webrtc/webrtc_logging_controller.cc b/chrome/browser/media/webrtc/webrtc_logging_controller.cc
|
|
--- a/chrome/browser/media/webrtc/webrtc_logging_controller.cc
|
|
+++ b/chrome/browser/media/webrtc/webrtc_logging_controller.cc
|
|
@@ -603,6 +603,7 @@ content::BrowserContext* WebRtcLoggingController::GetBrowserContext() const {
|
|
// static
|
|
bool WebRtcLoggingController::IsWebRtcTextLogAllowed(
|
|
content::BrowserContext* browser_context) {
|
|
+ if ((true)) return false;
|
|
// Historically by default webrtc text logs are always uploaded.
|
|
if (!browser_context) {
|
|
return true;
|
|
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
|
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
|
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
|
@@ -99,7 +99,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
|
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
|
|
registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls);
|
|
registry->RegisterBooleanPref(prefs::kWebRTCAllowLegacyTLSProtocols, false);
|
|
- registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, true);
|
|
+ registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, false);
|
|
|
|
// Dictionaries to keep track of default tasks in the file browser.
|
|
registry->RegisterDictionaryPref(
|
|
--
|
|
2.25.1
|