Skip to content

Commit

Permalink
disable chromium metrics providers
Browse files Browse the repository at this point in the history
  • Loading branch information
atuchin-m committed Oct 29, 2024
1 parent b94c3d6 commit 5fc4228
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "chrome/browser/metrics/chrome_metrics_service_client.h"

#define ChromeMetricsServiceClient ChromeMetricsServiceClient_ChromiumImpl
#include "src/chrome/browser/metrics/chrome_metrics_service_client.cc"
#undef ChromeMetricsServiceClient

void ChromeMetricsServiceClient::RegisterMetricsServiceProviders() {
// Do nothing.
}

void ChromeMetricsServiceClient::RegisterUKMProviders() {
// Do nothing.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_

#define ChromeMetricsServiceClient ChromeMetricsServiceClient_ChromiumImpl
#define RegisterMetricsServiceProviders virtual RegisterMetricsServiceProviders
#include "src/chrome/browser/metrics/chrome_metrics_service_client.h" // IWYU pragma: export
#undef RegisterMetricsServiceProviders
#undef ChromeMetricsServiceClient

class ChromeMetricsServiceClient
: public ChromeMetricsServiceClient_ChromiumImpl {
private:
void RegisterMetricsServiceProviders() override;
void RegisterUKMProviders() override;
};

#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc b/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
index 11548a8313dc775cb9bea3bc041d896e42ce305a..bbdced4ba79bd5722b74b0639e1c2bcfa7b6f250 100644
--- a/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
+++ b/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
@@ -310,11 +310,13 @@ void ChromeBrowserMainExtraPartsPerformanceManager::PreMainMessageLoopRun() {
performance_manager::user_tuning::UserPerformanceTuningManager::GetInstance()
->Start();

+#if 0 // Disabled in Brave
// This object is created by the metrics service before threads, but it
// needs the UserPerformanceTuningManager to exist. At this point it's
// instantiated, but still needs to be initialized.
performance_manager::MetricsProviderDesktop::GetInstance()->Initialize();
#endif
+#endif
}

void ChromeBrowserMainExtraPartsPerformanceManager::PostMainMessageLoopRun() {

0 comments on commit 5fc4228

Please sign in to comment.