Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set_manager_for_testing removed upstream
Chromium change: https://chromium.googlesource.com/chromium/src/+/3381daf526425ad5b99d5678adab03c073531531 commit 3381daf526425ad5b99d5678adab03c073531531 Author: Lily Chen <[email protected]> Date: Fri Apr 21 12:57:07 2023 +0000 [DownloadBubble] Defer GetDownloadManager() calls This defers calls to GetDownloadManager() to avoid calling it at startup, which may be expensive as it may cause the DownloadManager to be created immediately. These calls were potentially causing large performance regressions in startup time when the download bubble is enabled. This fixes 3 places: 1. DownloadBubbleUpdateService: This CL now splits the initialization of the service, adding a separate function to start listening to the DownloadManager (by creating an AllDownloadItemNotifier) after the DownloadManager is ready. This function is called from DownloadUIController's ctor, which runs immediately after the DownloadManager has been created by DownloadCoreService in GetDownloadManagerDelegate. 2. DownloadBubbleUIController: This CL removes the ctor call to GetDownloadManager() in favor of getting the manager only when needed, i.e. when retrying a download, by which time the manager should be initialized. 3. DownloadDisplayController: This was calling GetDownloadManager() on construction (i.e. startup) completely unnecessarily, to get the DownloadPrefs, which also has a getter based on BrowserContext. Bug: 1421426
- Loading branch information