[go: nahoru, domu]

Skip to content

Commit

Permalink
[Windows] Fix "dr" tracking
Browse files Browse the repository at this point in the history
r1202869 inadvertently removed the call to OnBrowserLaunch during normal
browser startup. The only remaining use for this function was to create
the browser's DidRunUpdater for normal launches. As a consequence,
post-launch "dr" tracking did not happen until the first rendezvous.

This change fixes "dr" tracking by moving creation of the browser's
DidRunUpdater back into ChromeBrowserMainPartsWin, where it lived until
r479139. This is now possible as a result of removal of the toast in
r1205320.

Fixed: 1516887
Change-Id: I5b2852886e4721f7ccc01f9edb3f09d964362958
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5177018
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1244787}
  • Loading branch information
GregTho authored and Chromium LUCI CQ committed Jan 9, 2024
1 parent ce80985 commit a8be832
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 63 deletions.
2 changes: 0 additions & 2 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5858,8 +5858,6 @@ static_library("browser") {
"accessibility/caption_settings_dialog_win.cc",
"badging/badge_manager_delegate_win.cc",
"badging/badge_manager_delegate_win.h",
"browser_process_platform_part_win.cc",
"browser_process_platform_part_win.h",
"browser_switcher/browser_switcher_policy_migrator.cc",
"browser_switcher/browser_switcher_policy_migrator.h",
"browser_switcher/browser_switcher_service_win.cc",
Expand Down
2 changes: 0 additions & 2 deletions chrome/browser/browser_process_platform_part.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
class BrowserProcessPlatformPart : public BrowserProcessPlatformPartChromeOS {};
#elif BUILDFLAG(IS_MAC)
#include "chrome/browser/browser_process_platform_part_mac.h" // IWYU pragma: export
#elif BUILDFLAG(IS_WIN)
#include "chrome/browser/browser_process_platform_part_win.h" // IWYU pragma: export
#else
#include "chrome/browser/browser_process_platform_part_base.h" // IWYU pragma: export
class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {};
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/browser_process_platform_part_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ BrowserProcessPlatformPartBase::BrowserProcessPlatformPartBase() {
BrowserProcessPlatformPartBase::~BrowserProcessPlatformPartBase() {
}

#if BUILDFLAG(ENABLE_PROCESS_SINGLETON)
void BrowserProcessPlatformPartBase::OnBrowserLaunch() {}
#endif

void BrowserProcessPlatformPartBase::StartTearDown() {
}

Expand Down
8 changes: 0 additions & 8 deletions chrome/browser/browser_process_platform_part_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_BASE_H_
#define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_BASE_H_

#include "chrome/browser/buildflags.h"

// A base class for platform-specific BrowserProcessPlatformPart
// implementations. This class itself should never be used verbatim.
class BrowserProcessPlatformPartBase {
Expand All @@ -20,12 +18,6 @@ class BrowserProcessPlatformPartBase {

virtual ~BrowserProcessPlatformPartBase();

#if BUILDFLAG(ENABLE_PROCESS_SINGLETON)
// Called after launch, whether it is from creating a new process or after
// rendezvous to an existing process via the process singleton.
virtual void OnBrowserLaunch();
#endif

// Called in the middle of BrowserProcessImpl::StartTearDown().
virtual void StartTearDown();

Expand Down
18 changes: 0 additions & 18 deletions chrome/browser/browser_process_platform_part_win.cc

This file was deleted.

27 changes: 0 additions & 27 deletions chrome/browser/browser_process_platform_part_win.h

This file was deleted.

2 changes: 0 additions & 2 deletions chrome/browser/chrome_browser_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,6 @@ void ProcessSingletonNotificationCallbackImpl(
}
#endif

g_browser_process->platform_part()->OnBrowserLaunch();

StartupProfilePathInfo startup_profile_path_info =
GetStartupProfilePath(current_directory, command_line,
/*ignore_profile_picker=*/false);
Expand Down
7 changes: 7 additions & 0 deletions chrome/browser/chrome_browser_main_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
Expand Down Expand Up @@ -545,6 +546,12 @@ void ChromeBrowserMainPartsWin::PostBrowserStart() {

InitializeChromeElf();

#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION)
if constexpr (kShouldRecordActiveUse) {
did_run_updater_.emplace();
}
#endif

// Query feature first, to include full population in field trial.
if (base::FeatureList::IsEnabled(features::kAppBoundEncryptionMetrics) &&
install_static::IsSystemInstall()) {
Expand Down
12 changes: 12 additions & 0 deletions chrome/browser/chrome_browser_main_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

#include "chrome/browser/chrome_browser_main.h"
#include "chrome/common/conflicts/module_watcher_win.h"
#include "chrome/install_static/buildflags.h"

#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION)
#include <optional>

#include "chrome/browser/google/did_run_updater_win.h"
#endif

class PlatformAuthPolicyObserver;

Expand Down Expand Up @@ -82,6 +89,11 @@ class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts {
void OnModuleEvent(const ModuleWatcher::ModuleEvent& event);
void SetupModuleDatabase(std::unique_ptr<ModuleWatcher>* module_watcher);

#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION)
// Updates Chrome's "did run" state periodically when the process is in use.
std::optional<DidRunUpdater> did_run_updater_;
#endif

// Watches module load events and forwards them to the ModuleDatabase.
std::unique_ptr<ModuleWatcher> module_watcher_;

Expand Down

0 comments on commit a8be832

Please sign in to comment.