From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Will Harris <wfh@chromium.org>
Date: Thu, 2 Mar 2023 17:01:49 +0000
Subject: Do not register browser_watcher activity report with crashpad

BUG=1415328

(cherry picked from commit f93c88303ccbb64014a575b8ae093aa166832922)

Change-Id: I109f6dac083a69a26841ee5e975e02093ca4cbf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4257669
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1106253}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4279942
Reviewed-by: Victor-Gabriel Savu <vsavu@google.com>
Commit-Queue: Zakhar Voit <voit@google.com>
Owners-Override: Victor-Gabriel Savu <vsavu@google.com>
Cr-Commit-Position: refs/branch-heads/5359@{#1401}
Cr-Branched-From: 27d3765d341b09369006d030f83f582a29eb57ae-refs/heads/main@{#1058933}

diff --git a/components/crash/core/app/BUILD.gn b/components/crash/core/app/BUILD.gn
index 09219dd91f4205b38b36d3f62483cf2e9fc3782b..a45dec6b0708a0b0df1fc0f62283c730611b93b7 100644
--- a/components/crash/core/app/BUILD.gn
+++ b/components/crash/core/app/BUILD.gn
@@ -159,7 +159,6 @@ if (is_win) {
     deps = [
       "//base",
       "//build:chromeos_buildflags",
-      "//components/browser_watcher:activity_report",
       "//components/gwp_asan/buildflags",
       "//third_party/crashpad/crashpad/client",
       "//third_party/crashpad/crashpad/handler",
diff --git a/components/crash/core/app/DEPS b/components/crash/core/app/DEPS
index 9717215396c918c46e683321115ed55ebcf6534d..9053a97a7068d5c3a240c9c7e99b0f7c2c2c038d 100644
--- a/components/crash/core/app/DEPS
+++ b/components/crash/core/app/DEPS
@@ -3,7 +3,6 @@ include_rules = [
   "+third_party/breakpad",
 
   "+components/crash/android/jni_headers",
-  "+components/browser_watcher/activity_report_user_stream_data_source.h",
   "+components/gwp_asan/buildflags/buildflags.h",
   "+components/gwp_asan/crash_handler/crash_handler.h",
   "+content/public/common/content_descriptors.h",
diff --git a/components/crash/core/app/run_as_crashpad_handler_win.cc b/components/crash/core/app/run_as_crashpad_handler_win.cc
index 5ae2702540dd635fa208f01ee84e92b2c2f1e220..ac2a160a172a75e6e4d12033b62c73551fb3e288 100644
--- a/components/crash/core/app/run_as_crashpad_handler_win.cc
+++ b/components/crash/core/app/run_as_crashpad_handler_win.cc
@@ -16,7 +16,6 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/platform_thread.h"
-#include "components/browser_watcher/activity_report_user_stream_data_source.h"
 #include "components/gwp_asan/buildflags/buildflags.h"
 #include "third_party/crashpad/crashpad/client/crashpad_info.h"
 #include "third_party/crashpad/crashpad/client/simple_string_dictionary.h"
@@ -81,15 +80,6 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line,
   argv.clear();
 
   crashpad::UserStreamDataSources user_stream_data_sources;
-  // Interpret an empty user data directory as a missing value.
-  if (!user_data_dir.empty()) {
-    // Register an extension to collect stability information. The extension
-    // will be invoked for any registered process' crashes, but information only
-    // exists for instrumented browser processes.
-    user_stream_data_sources.push_back(
-        std::make_unique<browser_watcher::ActivityReportUserStreamDataSource>(
-            user_data_dir));
-  }
 
 #if BUILDFLAG(ENABLE_GWP_ASAN)
   user_stream_data_sources.push_back(
